struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Larry Maturo" <lmat...@athensgroup.com>
Subject Parameter Passing
Date Fri, 10 Aug 2001 22:31:06 GMT
I have a page I can get two from two pages.  Say
I have page1, page2, and page3.  On page1
I have a table I fill using the iterate
tag, and one of the table entries is a link to page2,
but with a particular value.  Below is
the actual code for the link:

<html:link forward="reviewInstructions"
	paramId="reviewID"
      paramScope="page"
      paramName="review"
      paramProperty="reviewID">
      <bean:write name="review" property="reviewSubject" filter="true"/>
</html:link>

On the action class for page2 I extract reviewID with
	String reviewIDString = request.getParameter("reviewID");
and this works fine.

When the user presses next on page2 it takes them to page3, and
page3 repeats for a list of items, so that every time they press
next on page3 they get page3 again until they run out of items.  
When they press back on page3 and they are on the first item it 
takes them to page2.  This testing and forwarding is done in my 
action class for page3.  In order to get the page2 to work, it 
needs the reviewID, and I can't use:
	 request.setParameter("reviewID",ridString);
on page3, because request.setParameter does not exist.

So I figure I will just modify page1 to use an onclick handler
for the link, and have it set an attribute in the session
instead.  Something like:

<html:link forward="reviewInstructions"
	onclick='<%= request.getSession().setAttribute("reviewID",reviewID) %>'
	paramId="reviewID"
      paramScope="page"
      paramName="review"
      paramProperty="reviewID">
      <bean:write name="review" property="reviewSubject" filter="true"/>
</html:link>

but this, of course, does not compile.  In fact, I can't figure out any
way to get this to both compile and run.  If I resort to javascript here
and call a function, I need to pass the function the reviewID, and that
does not seem possible, because of the mixed context.

Since neither of these seems to be a viable way of doing things, what else
is there?


Larry Maturo


Mime
View raw message