• Post Reply Bookmark Topic Watch Topic
  • New Topic

IllegalStateException using RequestDispatcher

 
Vinnie Jenks
Ranch Hand
Posts: 207
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm finding it a problem to use the MVC/RequestDispatcher setup in a new app I'm building. I've always been able to do it w/o a problem, storing my jsp files in the /WEB-INF/ folder.

So, I'm using NetBeans (I normally use Eclipse + WTP) in this new project and while I can do RequestDispatcher to forward from a servlet to a jsp, the jsp files can't be in the /WEB-INF/ folder or the servlet throws an exception.

I did some searching before posting and found this:

http://www.coderanch.com/t/355724/Servlets/java/IllegalStateException-RequestDispatcher-forward

I have a hard time believing there's anything wrong w/ my files or that anything is being written to the output stream before the forward happens. I can take the jsp out of the /WEB-INF/ folder and put it in the root, and point the RequestDispatcher line in the servlet to the same jsp in the root and it works!

However, this isn't want I want, I'd like the JSPs in the /WEB-INF/ folder as I've always been able to do, until now.

Here's my Servlet:



Here's my JSP:



The exception I get (testing w/ Tomcat 5.5.7, netbeans bundled):



Any ideas?

Thanks!

-v
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65516
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What servlet container is Netbeans using? I always put my JSPs under WEB-INF and have never had any trouble whatsoever with either Tomcat or Resin.

if this is a Ntebeans-specific issue, it should probably be moved to te IDEs forum.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65516
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh, never mind. I see that it's Tomcat 5.5.

Seems like a Netbeans issue to me.

Question: if it's not your usual environment, and it's preventing you from working, why are you using it?
[ October 02, 2005: Message edited by: Bear Bibeault ]
 
Vinnie Jenks
Ranch Hand
Posts: 207
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Bear Bibeault:
Oh, never mind. I see that it's Tomcat 5.5.

Seems like a Netbeans issue to me.

Question: if it's not your ususal environment, and it's preventing you from working, why are you using it?

[ October 02, 2005: Message edited by: Bear Bibeault ]


I like the new Netbeans (5.0 beta), particularly for the ability to do Swing apps, J2ME, etc. all in one environment. I love Eclipse but just seeing if the grass is greener. If it weren't for this issue, I'd be very impressed!

It just doesn't make any sense, could it be a file permissions issue?

I can see how it *might* be Netbeans specific but this issue has obviously arisen for other people in other environments...see the link in my first post.

Anyhow...I'm starting to wonder if I've wasted my whole morning on friggin' Netbeans!!

Thanks Bear!
 
Vinnie Jenks
Ranch Hand
Posts: 207
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Uhm yeah........I created the exact same project in Eclipse (w/ webtools) and ran it under the Tomcat 5.5.9 server I config'd under eclipse and it runs just fine.

THAT settles it then! The grass ain't greener after all, I reckon.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!