Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

struts html:link

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I am rying something like this but it does not work. It gives me error like "Attribute empId has no value"
<html:link page="/execute/listEmployee?empId=<%= request.getParameter("empId") %>" >EMP</html:link>
Can anyone help?
 
Ranch Hand
Posts: 2676
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We don't have many rules at Javaranch, but our naming policy is one of them. Please read this policy and change your display name to comply with it if you wish to continue posting. Thanks.
You can change your display name here.
 
Ranch Hand
Posts: 374
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by germs germs:
Hi, I am rying something like this but it does not work. It gives me error like "Attribute empId has no value"
<html:link page="/execute/listEmployee?empId=<%= request.getParameter("empId") %>" >EMP</html:link>
Can anyone help?



You need to keep your rtexpr's really simple. Basically, if it has quotes in it, don't do it. Declare a page variable in a scriptlet if you have to, i.e.
<%String empId = request.getParameter("empId");%>
<html:link page="/execute/listEmployee?empId=<%= empId %>" >EMP</html:link>
or, in this very simple case, use the struts bean define or parameter tags. Then you can use the html:link parameter information for your link...
[ January 13, 2003: Message edited by: David Hibbs ]
 
Sheriff
Posts: 6450
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It should work if you replace a pair of the double quotes with single quotes. Your tag is getting confused about where one part ends and another begins.
 
irene lee
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi David,
I tried declarind a variable as what u have stated but still it does not work.
<%String empId = request.getParameter("empId");%>
<html:link page="/execute/listEmployee?empId=<%= empId %>" >EMP</html:link>
supposingly i should give me a link showing:
http://localhost/testing/execute/listEmployee?empId=1
However it gives me ssomething like this :
http://localhost/testing/execute/listEmployee?empId=<%= empId %>

Any idea?

Originally posted by David Hibbs:


You need to keep your rtexpr's really simple. Basically, if it has quotes in it, don't do it. Declare a page variable in a scriptlet if you have to, i.e.
<%String empId = request.getParameter("empId");%>
<html:link page="/execute/listEmployee?empId=<%= empId %>" >EMP</html:link>
or, in this very simple case, use the struts bean define or parameter tags. Then you can use the html:link parameter information for your link...
[ January 13, 2003: Message edited by: David Hibbs ]


[ January 13, 2003: Message edited by: irene lee ]
 
Ranch Hand
Posts: 166
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am having the same issue, if any one could help out that would be great.
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
try something like this:

 
Be reasonable. You can't destroy everything. Where would you sit? How would you read a tiny ad?
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic