Java Mailing List Archive

http://www.junlu.com/

Google
Google
Mailing List
Home
Forum Home
JBoss - Java Application Server
Tomcat - JSP/Servlet container
Struts - A MVC web framework
iText - An open source PDF Java Library
JDOM - JDOM XML Parser
J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition
JSP - A mailing list about Java Server Pages specification and reference
J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog
Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology
Struts & Hibernate
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Servlet : Session invalidate
Oracle Connection Pooling in 3 2 2
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Running a Simple JMS Example
Tomcat and webapplication specific java library path
Mapping in workers2 properties
org apache jasper JasperException
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action
   MESSAGE
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
Value attribute of <html:checkbox
url string for connecting jboss to oracle
javax servlet ServletException: BeanUtils populate
5 0 18: Windows XP Pro vs Windows 2000
HTTP Status 404 The requested resource is not available
 
-none-

-none-

2007-09-04       - By Frank W. Zammetti

 Back
Oh, you know what, my bad... I'm on vacation this week and my brain is
shut down even more than some would say it normally is... you asked
about Struts2, and I answered for Struts1.  Sorry about that, ignore
what I said.

For S2, let's say you have a String property "name" on your
HelloWorldAction class, you can use:

<s:property value="name"/>

...in your JSP to display it.  You'll also need:

<%@(protected) prefix="s" uri="/struts-tags" %>

...to make that work.  And of course, make sure you have an appropriate
getter method on the Action too.

Frank

--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM/Yahoo: fzammetti
MSN: fzammetti@(protected)
Author of "Practical Ajax Projects With Java Technology"
 (2006, Apress, ISBN 1-59059-695-1)
and "JavaScript, DOM Scripting and Ajax Projects"
 (2007, Apress, ISBN 1-59059-816-4)
Java Web Parts - http://javawebparts.sourceforge.net
 Supplying the wheel, so you don't have to reinvent it!

REMIJAN, MICHAEL J [AG/1000] wrote:
> So if I have "helloworld.action" defined as:
>
> <action name="helloworld" class="test.struts.HelloWorldAction">
> <result>/WEB-INF/jsp/helloworld.jsp</result>
> </action>  
>
> Then I can retrieve the object with:
>
> MyActionForm form = (MyActionForm)request.getAttribute("helloworld");
>
> ??
>
>
> -- --Original Message-- --
> From: Frank W. Zammetti [mailto:fzlists@(protected)]
> Sent: Tuesday, September 04, 2007 8:31 AM
> To: Struts Users Mailing List
> Subject: Re: How to access the ActionForm in a JSP?
>
> You can find the form as a request attribute with the same name you used
>
> in your config file, so:
>
> MyActionForm form = (MyActionForm)request.getAttribute("myFormName");
>
> Frank
>
> --
> Frank W. Zammetti
> Founder and Chief Software Architect
> Omnytex Technologies
> http://www.omnytex.com
> AIM/Yahoo: fzammetti
> MSN: fzammetti@(protected)
> Author of "Practical Ajax Projects With Java Technology"
>   (2006, Apress, ISBN 1-59059-695-1)
> and "JavaScript, DOM Scripting and Ajax Projects"
>   (2007, Apress, ISBN 1-59059-816-4)
> Java Web Parts - http://javawebparts.sourceforge.net
>   Supplying the wheel, so you don't have to reinvent it!
>
> REMIJAN, MICHAEL J [AG/1000] wrote:
>> Newbie question here.  Suppose I have action, "helloworld.action"
> which
>> I use to grab a bunch of data I wish to display on a JSP page.  My
>> question is how do get a reference to that action object in the JSP
>> page?  The tutorials on the Struts2 website showed examples using
> <form
>> /> tags, but I don't need to use <form /> tags.  I just want to
> display
>> data.
>>
>> Michael J. Remijan
>>
>>
>>
> -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
> -- ---- ---- ---- ---- ---- -----
>> This e-mail message may contain privileged and/or confidential
> information, and is intended to be received only by persons entitled to
> receive such information. If you have received this e-mail in error,
> please notify the sender immediately. Please delete it and all
> attachments from any servers, hard drives or any other media. Other use
> of this e-mail by you is strictly prohibited.
>>
>> All e-mails and attachments sent and received are subject to
> monitoring, reading and archival by Monsanto. The recipient of this
> e-mail is solely responsible for checking for the presence of "Viruses"
> or other "Malware". Monsanto accepts no liability for any damage caused
> by any such code transmitted by or accompanying this e-mail or any
> attachment.
> -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
> -- ---- ---- ---- ---- ---- -----
>>
>>
>>
>>
> -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
>> No virus found in this incoming message.
>> Checked by AVG Free Edition.
>> Version: 7.5.485 / Virus Database: 269.13.3/986 - Release Date:
> 9/3/2007 9:31 AM
>
>
> -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>
> -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
-- ---- ---- ---- ---- -----
> This e-mail message may contain privileged and/or confidential information,
and is intended to be received only by persons entitled to receive such
information. If you have received this e-mail in error, please notify the
sender immediately. Please delete it and all attachments from any servers, hard
drives or any other media. Other use of this e-mail by you is strictly
prohibited.
>
>
> All e-mails and attachments sent and received are subject to monitoring,
reading and archival by Monsanto. The recipient of this e-mail is solely
responsible for checking for the presence of "Viruses" or other "Malware".
Monsanto accepts no liability for any damage caused by any such code
transmitted by or accompanying this e-mail or any attachment.
> -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
-- ---- ---- ---- ---- -----
>
>
> -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>
>
>


-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)


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