• Post Reply Bookmark Topic Watch Topic
  • New Topic

problem in forward()  RSS feed

 
sachin yadav
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,

i have a page which is authenticating user id and password send from previous page. on found correct the page must be forwarded to a search page. i am using---

_______code__________

PageContext.forward("search.jsp");
____________________________

but i was give a error message on run saying that forward in not static.
why???

sachin
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66157
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you not think that it would be helpful to show us the complete error message?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The error message says it all.
You are trying to use a non-static method (forward) of the PageContext class.

It would also be helpful to know where you are trying to forward the request.
(post some code)

In JSP, you may have a look at the <jsp:forward> action.
In a servlet, look at the request dispatcher's forward method
(see ServletRequest::getRequestDispatcher in the API)
[ December 25, 2005: Message edited by: Satou kurinosuke ]
 
Vasudhaiv Naresh
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sataou,
try this-
pageContext.forward("---");
Note the lower case 'p' in 'pageContext'.
Regards,
Naresh
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Vasudhaiv,

I'm not the own asking, so please reply to sachin
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!