wood burning stoves 2.0*
The moose likes Struts and the fly likes jsp:param usage Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "jsp:param usage" Watch "jsp:param usage" New topic
Author

jsp:param usage

sanat
Ranch Hand

Joined: Dec 08, 2004
Posts: 111

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

Joined: Jan 10, 2002
Posts: 60741
    
  65

${param.name}


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Poobhathy Kannan
Ranch Hand

Joined: May 26, 2004
Posts: 94
you can try Jakarta's request taglibrary
Have a look here >>


http://learnertobeginner.blogspot.com/
sanat
Ranch Hand

Joined: Dec 08, 2004
Posts: 111


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

Joined: Jan 10, 2002
Posts: 60741
    
  65

Did you read my earlier response?

sanat
Ranch Hand

Joined: Dec 08, 2004
Posts: 111

Hi

Can I use this

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60741
    
  65

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

Joined: Dec 08, 2004
Posts: 111



This one is working.

Thanks All.
sanat
Ranch Hand

Joined: Dec 08, 2004
Posts: 111

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

Joined: Dec 08, 2004
Posts: 111

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

Joined: Jan 10, 2002
Posts: 60741
    
  65

I already gave you a working example.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

How about:




Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
sanat
Ranch Hand

Joined: Dec 08, 2004
Posts: 111

Originally posted by Ben Souther:
How about:




It won't work.

Can I get code for struts alternative?

Thanks.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

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

Joined: Jan 10, 2002
Posts: 60741
    
  65

Movde to the Struts forum since only a Struts solution seems acceptable.
sanat
Ranch Hand

Joined: Dec 08, 2004
Posts: 111

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

Joined: Jan 09, 2001
Posts: 23
Hi sanat,

try the following struts solution:


I hope it helps !!!

Anil Sadineni.
[ April 01, 2005: Message edited by: Anil Sadi ]
sanat
Ranch Hand

Joined: Dec 08, 2004
Posts: 111

Thanks Anil,

That code works.
 
Don't get me started about those stupid light bulbs.
 
subject: jsp:param usage
 
Similar Threads
How do I access a value in an include from a parent jsp
jsp:param usage
Customizing the included content with <jsp:param>
how to get object of this below chart and write in to pdf here strXMl is string of xml
Using jsp:param and expression scripting element