Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Struts 2 »

struts2.0 action question

red phoenix

2006-12-13

Replies:

I am puzzled with struts2.0 action file,my files are follows:

configure file is follows
<action name="createRoom" class="crudRoomAction" method="create">
 <result name="read">/chat/read.jsp</result>
 <result name="write">/chat/write.jsp</result>
</action>

action file is follows:
public String execute() throws Exception {
 String flag=request.getParameter("flag");
 if("1".equals(flag))
  return SUCCESS;
 else if("2".equals(flag))
  return READ;
 else
  return WRITE;
}

when I compile my action file,it raise error,say READ and WRITE don't
define.I am puzzled with it. Why SUCCESS is define,READ and WRITE don't
define? I don't find anywhere to define SUCCESS! How to do it?
if return SUCCESS,it will go to which page,read.jsp or write.jsp?

Anyone could get rid of my puzzled?

Thanks
©2008 junlu.com - Jax Systems, LLC, U.S.A.