Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / September 2006

Tip: Looking for answers? Try searching our database.

Struts - I dont get it

Thread view: 
timasmith@hotmail.com - 19 Aug 2006 13:27 GMT
I can create a jsp which submits a form which is processed by an Action
class.

Not a problem.

But I cant seem to do the next logical step.

Go from my output jsp

   <c:url value="/ArtifactTree.do" var="url">
        <c:param name="productRefId" value="${product.refId}"/>
    </c:url>
<a href="<c:out value="${url}"/>"><c:out
value="${product.display}"/></a>

to the ArtifactTreeAction class which should pull in business data and
pass to the target jsp.

Please dont bother with replying if you are just to go say read the
examples war or the Apache tutorial - it is not helpful.
relogout@gmail.com - 19 Aug 2006 14:25 GMT
do you mean you can't dispaly data in the jsps?

> I can create a jsp which submits a form which is processed by an Action
> class.
[quoted text clipped - 16 lines]
> Please dont bother with replying if you are just to go say read the
> examples war or the Apache tutorial - it is not helpful.
timasmith@hotmail.com - 20 Aug 2006 00:22 GMT
> do you mean you can't dispaly data in the jsps?
>
[quoted text clipped - 18 lines]
> > Please dont bother with replying if you are just to go say read the
> > examples war or the Apache tutorial - it is not helpful.

Right.  I get it now (finally geesh)

I can read the productRefId parameter in the Action class by creating a
dynamic form and using PropertyUtils.getSimpleProperty

Then in the action class i can use
request.setAttribute("artifact",artifact) and finally in the jsp I can
reference that attribute directly with
<c:out value="${artifact.field}" />

So confusing being new to it but rather slick once you get to it.

Now I just have to figure out the best way to organize all these files,
string parameter names etc.
richardsosborn@gmail.com - 23 Aug 2006 18:01 GMT
I had a REALLY hard time with struts tags.  The "name", "property", etc
compared to plain HTML were confusing for a long time.  Then the Ted
Husted book explained it for me.

Think of the tags as accessing a java bean.   The names address those
portions of the bean.  It made it simpler.

> > do you mean you can't dispaly data in the jsps?
> >
[quoted text clipped - 33 lines]
> Now I just have to figure out the best way to organize all these files,
> string parameter names etc.
Tim B - 04 Sep 2006 19:44 GMT
> I can create a jsp which submits a form which is processed by an Action
> class.
[quoted text clipped - 16 lines]
> Please dont bother with replying if you are just to go say read the
> examples war or the Apache tutorial - it is not helpful.

Can you be more specific? What html does the above put out?


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.