• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

jsp:param usage

 
Ranch Hand
Posts: 111
Mac Eclipse IDE Java
  • 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.
 
Marshal
Posts: 67451
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
${param.name}
 
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
Mac Eclipse IDE Java
  • 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
Marshal
Posts: 67451
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you read my earlier response?

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

Can I use this

 
Bear Bibeault
Marshal
Posts: 67451
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • 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
Mac Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


This one is working.

Thanks All.
 
sanat
Ranch Hand
Posts: 111
Mac Eclipse IDE Java
  • 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
Mac Eclipse IDE Java
  • 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
Marshal
Posts: 67451
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I already gave you a working example.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How about:


 
sanat
Ranch Hand
Posts: 111
Mac Eclipse IDE Java
  • 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 VI Editor Redhat
  • 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
Marshal
Posts: 67451
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Movde to the Struts forum since only a Struts solution seems acceptable.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic