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: 1162

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

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

However, this returns null. Any ideas?



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 request =
String viewType = request.getParameter("viewType");

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

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.