Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting parameters off of the URL

Status
Not open for further replies.

Nondescripthandle

Programmer
Oct 1, 2003
3
CA
This is something that is dead easy in straight JSP, but I want to know how to do it in struts.

I have a URL which is passing parameters sub and func.

In JSP, I'd just do
<% String subject=request.getParameter(&quot;sub&quot;);
String function=request.getParameter(&quot;func&quot;);
%>

In struts, I'm trying to do this:

<logic:notPresent scope=&quot;request&quot; name=&quot;func&quot;>
<bean:define id=&quot;function&quot; value=&quot;none&quot;/>
</logic:notPresent>
<logic:notPresent scope=&quot;request&quot; name=&quot;sub&quot;>
No sub-heading passed
<bean:define id=&quot;subject&quot; value=&quot;none&quot;/>
</logic:notPresent>
<logic:present scope=&quot;request&quot; name=&quot;func&quot;>
<bean:define id=&quot;function&quot; name=&quot;request&quot; property=&quot;func&quot;/>
</logic:present>
<logic:present scope=&quot;request&quot; name=&quot;sub&quot;>
Found one
<bean:define id=&quot;subject&quot; name=&quot;request&quot; property=&quot;sub&quot;/>
</logic:present>

No matter what I do, the logic tags never find the request parameters in the request object. Is there something really dumb-assed that I'm missing?

Thanks
-Hugh
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top