• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

can not forward after response has been committed

 
Ranch Hand
Posts: 231
Tomcat Server Notepad Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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??
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Tomcat Server Notepad Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Tomcat Server Notepad Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
to jeanne...

its showing ""IllegalStateException"" ..
 
shivam singhal
Ranch Hand
Posts: 231
Tomcat Server Notepad Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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..

:)
 
reply
    Bookmark Topic Watch Topic
  • New Topic