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

jsp:param usage

 
sanat
Ranch Hand
Posts: 111
Eclipse IDE Java Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Generally we use <jsp:include> like this



Is there is any other way so that I don't have to use scriptlets in header.jsp. Is there is some struts or JSTL tag that can be used to get the request parameter. Is there is any expression language alternative?

Thanks in advance.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64985
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
${param.name}
 
Poobhathy Kannan
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can try Jakarta's request taglibrary
Have a look here >>
 
sanat
Ranch Hand
Posts: 111
Eclipse IDE Java Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

header.jsp
-----------
<% String name = request.getParameter("name");
if(name.equals("sanat")){
%>
Welcome
<% } %>


Is there is any struts alternative. Can anyone show me what's best way to write this code, so that it man minimize use of scriptlets.

Thanks in advance.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64985
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you read my earlier response?

 
sanat
Ranch Hand
Posts: 111
Eclipse IDE Java Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

Can I use this

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64985
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How does that "minimize use of scriptlets"?

And, why use proprietary tags when standardized tags are available?
[ March 30, 2005: Message edited by: Bear Bibeault ]
 
sanat
Ranch Hand
Posts: 111
Eclipse IDE Java Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


This one is working.

Thanks All.
 
sanat
Ranch Hand
Posts: 111
Eclipse IDE Java Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by sanat kumar padhy:



Is the usage is correct? What about other attributes like parameter, property. Where to use these attributes?

Thanks in advance.
 
sanat
Ranch Hand
Posts: 111
Eclipse IDE Java Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by sanat kumar padhy:


This one is working.

Thanks All.


Sorry this is not working. Can anyone provide the proper usage?

Thanks in advance.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64985
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I already gave you a working example.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How about:


 
sanat
Ranch Hand
Posts: 111
Eclipse IDE Java Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ben Souther:
How about:




It won't work.

Can I get code for struts alternative?

Thanks.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by sanat kumar padhy:
It won't work.

"It won't work" doesn't tell us much.
Are you getting an error message?
Have you tried printing the value of the param to the page to see what is really getting there?

Originally posted by sanat kumar padhy:

Can I get code for struts alternative?


Maybe, in the Struts forum.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64985
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Movde to the Struts forum since only a Struts solution seems acceptable.
 
sanat
Ranch Hand
Posts: 111
Eclipse IDE Java Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by sanat kumar padhy:
Generally we use <jsp:include> like this




Hi all,

Can I get a struts solution for this.

Thanks in advance.
 
Anil Sadi
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi sanat,

try the following struts solution:


I hope it helps !!!

Anil Sadineni.
[ April 01, 2005: Message edited by: Anil Sadi ]
 
sanat
Ranch Hand
Posts: 111
Eclipse IDE Java Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Anil,

That code works.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic