• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
Bartenders:
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

html link with params

 
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
I'm feeling great by logging into javaranch after
a gap of 2 yrs. I was a regular visiter when i was preparing for my SCJP.
Here's my query:
How do i pass params along with link?
i tried this:
<html:link href="/web-struts/navigator.do?action=edit_fra&franchiseeName=<%=theVO.getFranchiseeId() %>" >
<%=theVO.getFranchiseeName()%>
</html:link>
its not working as expected. mainly not substituting the value.
Any ans?
Thanks,


vadi
[ June 04, 2002: Message edited by: Vadiraj Deshpande ]
 
Ranch Hand
Posts: 567
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well that's a problem with your code then, since that link tag looks fine. I take it you mean that the parameter is null when it arrives back at the server?
 
Vadiraj Deshpande
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Adam Hardy:
Well that's a problem with your code then, since that link tag looks fine. I take it you mean that the parameter is null when it arrives back at the server?


Hi Adam,
Well the problem is : The inside scriptlet is not executing.
The code:
<html:link href="/web-struts/navigator.do?action=edit_fra&fra_id=<%=theVO.getFranchiseeId()%>" >
<%=theVO.getFranchiseeName()%>
</html:link>
The URI when the page is executed:
/web-struts/navigator.do?action=edit_fra&fra_id=<%=theVO.getFranchiseeId()%>
And the value of franchiseeid is not null.
Thnx,
vadi
[ June 05, 2002: Message edited by: Vadiraj Deshpande ]
 
Sheriff
Posts: 6450
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You could do something like the following:

Personally I would prefer to put the scriptlet code in the Action and have it place the Map into the request before forwarding to the jsp. I would also have the Action place 'theVO' into the proper scope and access it that way as opposed to using a <jsp:useBean> which it looks like you are doing. In addition, I would also use <bean:write> instead of the scriptlet for getFranchiseName().
In any case, I suggest you check out the taglib documentation for further clarification. Hope this helps.
[ June 05, 2002: Message edited by: Jason Menard ]
 
Vadiraj Deshpande
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jason Menard:
You could do something like the following:

Personally I would prefer to put the scriptlet code in the Action and have it place the Map into the request before forwarding to the jsp. I would also have the Action place 'theVO' into the proper scope and access it that way as opposed to using a <jsp:useBean> which it looks like you are doing. In addition, I would also use <bean:write> instead of the scriptlet for getFranchiseName().
In any case, I suggest you check out the taglib documentation for further clarification. Hope this helps.
[ June 05, 2002: Message edited by: Jason Menard ]


Hi Jason,
Thanks a lot for your help. Your solution was excellent. I'm getting a collection of VO's from the Action and getting individual VO's and creating the link with them in the jsp. I'm not using any <jsp:useBean>.
Any further improvements possible?
Thnx again,
vadi
 
Jason Menard
Sheriff
Posts: 6450
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ahh.. okay I get it. That's the body of some iteration (using <logic:iterate> perhaps?). Anyway, glad that worked for you, best of luck on your project.
 
Vadiraj Deshpande
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jason Menard:
Ahh.. okay I get it. That's the body of some iteration (using <logic:iterate> perhaps?). Anyway, glad that worked for you, best of luck on your project.


Hi Jason,
Yes you got it right. Thanks again.
Cheers,
vadi
 
reply
    Bookmark Topic Watch Topic
  • New Topic