Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sending more than one parameter

 
Daniel Rosa
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all!!

I've got the following code in a hedear.jsp:

<s:url action="login.action" var="urlTag">
<s:param name="username"><s:property value="%{#session.username}"></s:property></s:param>
<s:param name="password"><s:property value="%{#session.password}"></s:property></s:param>
</s:url>
<a href="<s:property value="#urlTag" />" >Home</a>

I set a link, and I'm trying to pass to the loginAction.java file two parameters: username and password.
Only works username. The second parameter (password) is not loaded on the Action.

Of course, password has a correct value. I tried to pass only the parameter password, and it worked!

The issue is that in this way I've not been able to send more than one parameter...

May be this is not allowed, or I'm doing something wrong?

Thanks in advance!
 
Daniel Rosa
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi again.

I just discovered the following: when I pass the mouse over the link on the navigator (without clicking over it), I can read the following at the bottom of the navigator:

http://localhost/si3/login.Action?username=EMP2&amp;passwrod=emp2

Of course, the trouble is that the string "amp;" is wrong. I don't know why it appears on the link. Obviously, is not going to work. In fact, only gets the first parameter.

Anyone knows how to avoid this?

With best regards,
Dani.
 
Daniel Rosa
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello again.

I found the solution. Te attribute escapeAmp must be set to false. This solve the trouble.

<s:url action="login.action" var="urlTag" escapeAmp="false">
<s:param name="username"><s:property value="%{#session.username}"></s:property></s:param>
<s:param name="password"><s:property value="%{#session.password}"></s:property></s:param>
</s:url>
<a href="<s:property value="#urlTag" />" >Home</a>

Greets!!!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic