Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

first whack at JSP not working

 
paul wheaton
Trailboss
Pie
Posts: 21513
Firefox Browser IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I made a tiny JSP like this:

And I called it test.jsp
fragment.html contains a pinch of text, nothing more.
If I take out the "<%@ include file="fragment.html" %>", the page comes up fine. If I leave it in, I see:
500 Internal Server Error
JSP Parse Error
JSP Directive <%@ %> fileis not recognized.
I'm using JRun. What am I doing wrong?
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Paul,
Change "file" to "page".
 
paul wheaton
Trailboss
Pie
Posts: 21513
Firefox Browser IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay - I made the change and now I get:
500 Internal Server Error
JSP Parse Error
JSP Directive <%@ %> pageis not recognized.
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Paul,
Sorry, "file" is correct. If you keep the two files in the same directory, then it should work. Have you tried the demo samples?
 
paul wheaton
Trailboss
Pie
Posts: 21513
Firefox Browser IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's the demo samples that are not working.
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
which server/JSP engine are you using?
 
paul wheaton
Trailboss
Pie
Posts: 21513
Firefox Browser IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using JRun, although I think I found out that it is not JSP 1.1 compliant. And the include tag I'm trying to use is a 1.1 thing.
I've downloaded Tomcat and am struggling to get it working.
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Paul,
If you really wish to get into this jSP thing, perhaps you should buy the book "web development with java server pages" by Duane Fields & Mark Kolb. It is available also as an e-book for a mere $13.50. You can also ask questions in their website forum.
http://www.manning.com/Fields/index.html
The book has an appendix which helps with configuration.
Gook luck,
 
paul wheaton
Trailboss
Pie
Posts: 21513
Firefox Browser IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks sheil.
I bought that book a few days ago.
I now have tomcat running and my stuff seems to be working okay. Time to do some serious reading.
Thanks for the tip on the forum. I'll probably head out there.
 
Tony Alicea
Desperado
Sheriff
Posts: 3226
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I too recommend the book by Duane Fields & Mark Kolb. Highly.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic