Struts - I dont get it

T

timasmith

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:eek:ut value="${url}"/>"><c:eek:ut
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.
 
T

timasmith

do you mean you can't dispaly data in the jsps?

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:eek:ut 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.
 
R

richardsosborn

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.
 
T

Tim B

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:eek:ut value="${url}"/>"><c:eek:ut
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.


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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top