Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

can not forward after response has been committed

 
shivam singhal
Ranch Hand
Posts: 231
Java Notepad Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<%@ page import="com.example.web.*" %>

name.jsp

<html>
<body>
<center><h1>Your Name Is ::
<br>
<jsp:useBean id="Work" class="com.example.web.Work" scope="request"/>
your job is :: <jsp:getProperty name="Work" property="job" />
</h1></center>
</body>
</html>




Work.java

package com.example.web;
public class Work{
private String wrk;
public void setJob(String wrk1){
this.wrk=wrk1;
}
public String getJob(){
return wrk;
}
}

in between there is a servlet code which have no errors..

must be an error in the highlitted Property atribute...
can sombody resolves it??
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34973
379
Eclipse IDE Java VI Editor
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you sure Work isn't null in the request? The only thing I can see wrong on that line is the possibility of a NullPointer.
 
shivam singhal
Ranch Hand
Posts: 231
Java Notepad Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey jeanne thanks for helping..

yups.. Work in this case is not null..
here is my servlet code..

 
shivam singhal
Ranch Hand
Posts: 231
Java Notepad Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
to jeanne...

its showing ""IllegalStateException"" ..
 
shivam singhal
Ranch Hand
Posts: 231
Java Notepad Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks jeanne for helping and providing clue of error....
goota my error..

that is ...
request can't be forward more than once from servlet to jsp..

:)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic