Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Obtaining URL parameter in JSP Custom Tag

  Asked By: Oscar    Date: Nov 29    Category: Java    Views: 1301
  

I am trying to obtain a URL parameter in my JSP custom
tag.

This is the code I am trying...
ServletRequest request = pageContext.getRequest();
String viewType = request.getParameter("viewType");

However, this returns null. Any ideas?

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Geraldine Perkins     Answered On: Nov 29

First, there may be no such parameter  named as
"viewType". I mean check the name and spellings.

Secondly, try following code. In the following code  i
have typecast the request  object into
"HttpServletRequest".

HttpServletRequest request =
(HttpServletRequest)pageContext.getRequest();
String viewType = request.getParameter("viewType");

Try this 'coz i have done this many times by this
method.

 
Didn't find what you were looking for? Find more on Obtaining URL parameter in JSP Custom Tag Or get search suggestion and latest updates.




Tagged: