You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "T. Wheeler" <to...@swbell.net> on 2001/12/18 04:19:05 UTC

How to use ActionMessages *and* redirects

Hello,

In my application, I need to show status messages after a record is
updated.  I am using ActionMessages to do this -- and it works.

However, there is some other information on the page that shows the status
message.  The user will very likely refresh this page so that information is
updated, but doing so will cause the update form to re-post.  I could
prevent this by redirecting to the status message page instead of forwarding
(i.e. so the URL in the browser's address bar is updated). When I set up the
mapping for the status message page to redirect="true" in the
struts-config.xml, the status messages stopped being displayed.  

Is there any way that I can get the ActionMessage associated with the
request to persist past the redirect?

Thanks-

Tom

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


How to use an expression in a logic tag?

Posted by "T. Wheeler" <to...@swbell.net>.
Hello,

I am using logic tags to implement paging through a recordset (like in a
search engine).

In order to determine whether or not to display the "next page" button (i.e.
when the user is nearing the end of the recordset) it seems I need an
expression in my <logic:greaterEqual> tag.

I have a bean that contains these properties:

	maxRecords: 	Number of records to display per page
	rowPosition:	index number of the first row on this page

I also have the value totalRecords, which is passed into the request object
in my action class.  It is not a property of the form bean.

I need to do something like:

<logic:greaterEqual name="MyFormBean" property="SEE BELOW" value="<%=
totalRecords %>">
	<input type="submit" name="next" value="Next Page">
</logic:greaterEqual>

Where the property would actually need to be an expression like rowPosition
+ maxRecords

Does anyone know how I could do this?  

Thanks!

Tom

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: How to access value of a form bean property inside a scriptlet?

Posted by Taylor Cowan <tc...@silverstream.com>.
I think the form bean is stored in the session or request scope by the name
of the action.  So it would be request.getAttribute or session.getAttribute.

request/session option is specified in the actions config.

Taylor

-----Original Message-----
From: T. Wheeler [mailto:tomwheel@swbell.net]
Sent: Friday, December 21, 2001 5:47 PM
To: struts-user@jakarta.apache.org
Subject: How to access value of a form bean property inside a scriptlet?


I know that scriptlets are generally frowned upon, but can someone please
say how to access the value of a property in a form bean inside a scriptlet?

I need to be able to send the value of that property to a method call inside
the scriptlet, like:

<%
	String fooTranslated = translator.translate(<bean:write name="MyBean"
property="myProp"/>);
%>

Thanks-

Tom

--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


How to access value of a form bean property inside a scriptlet?

Posted by "T. Wheeler" <to...@swbell.net>.
I know that scriptlets are generally frowned upon, but can someone please
say how to access the value of a property in a form bean inside a scriptlet?

I need to be able to send the value of that property to a method call inside
the scriptlet, like:

<%
	String fooTranslated = translator.translate(<bean:write name="MyBean"
property="myProp"/>);
%>

Thanks-

Tom

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>