aspose file tools*
The moose likes JSP and the fly likes can not forward after response has been committed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "can not forward after response has been committed" Watch "can not forward after response has been committed" New topic
Author

can not forward after response has been committed

shivam singhal
Ranch Hand

Joined: Jul 15, 2012
Posts: 226

<%@ 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

Joined: May 26, 2003
Posts: 31062
    
232

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.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
shivam singhal
Ranch Hand

Joined: Jul 15, 2012
Posts: 226

hey jeanne thanks for helping..

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

shivam singhal
Ranch Hand

Joined: Jul 15, 2012
Posts: 226

to jeanne...

its showing ""IllegalStateException"" ..
shivam singhal
Ranch Hand

Joined: Jul 15, 2012
Posts: 226

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..

:)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: can not forward after response has been committed