This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP's dynamic content not getting displayed

 
himanshu.harish agrawal
Ranch Hand
Posts: 47
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I have written a very basic JSP as below:


But I am unable to see sysout in my console, which means that my scriplet is not getting displayed.
In am running it in Apache tomcat container 5.5.30.

If we see then JSP are complied under "work" directory for the generated servlet. But that directory is also not having any generated servlet. So, basically mu JSPs are not getting compiled and hence page is showing up as simple HTML page.

I having a hard time rectifying it. Somebody kindly help me out!

Regards,
Himanshu
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64708
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's likely sending the output to a log file somewhere. In any case, scriptlets have been discredited since 2002. You should no longer be using them in JSP pages.
 
Stefan Evans
Bartender
Posts: 1691
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looks fine to me.
What do you get when you invoke this page?
What url are you using to access it?

Maybe try something more complex in the page:
Here is a simple example that prints out server info, and checks EL expressions:




 
himanshu.harish agrawal
Ranch Hand
Posts: 47
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Stefan,

Greetings and thanks for reply!!!

Below is the output which I got


Which suggests that my scriplets are not executing. And as I said I am not even getting compiled JSP servlets under "work" directory.
NOTE: I am not manually compiling my JSPs through ant task. I remember tomcat compiles them on its own.
My web context root is "webdav" and I am running it as below
Just as a try out I have tried to run this both in Jakarat Tomcat 5.0 also apart from Apache Tomcat 5.5.33 but none is displaying JSPs correctly. Initially I tried with default configurations and then I tried adding "Context" element in my conf/server.xml. But none is helping.
I remember that few months back I also was able to execute JSPs but then later my system was reformatted and now with new installation all these softwares My JAVA_HOME env. variable is also correctly set.
I am unable to execute my JSPs. :(

Please help me out as I am preparing for OCPWCD and my JSP container is not working. :(

Regards,
Himanshu
 
himanshu.harish agrawal
Ranch Hand
Posts: 47
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:It's likely sending the output to a log file somewhere. In any case, scriptlets have been discredited since 2002. You should no longer be using them in JSP pages.


Hello Bear,

Thanks for reply!!!

Ok, please see me rely which I have posted to Stefan. Even those scripltes are not working for me. It seems my JSP container is not working as my JSPs are not compiling.


Regards.
Himanshu
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64708
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
YOur web app is likely misconfigured.

Start from scratch building a web app one step at a time, making sure that it works each step along the way.

Start by creating the context root folder, a simple index.jsp containing a minimal EL expressions such as ${3+4}, a WEB-INF folder, and a minimum web.xml in WEB-INF. Make sure this starts in Tomcat. Until you can get this working any other work is wasted time.
 
himanshu.harish agrawal
Ranch Hand
Posts: 47
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:YOur web app is likely misconfigured.

Start from scratch building a web app


Hello Bear,

Thanks a lot!!! Yes, there were some issues in my web.xml; actually I configured a servlet in my web.xml but later I deleted that servlet but didn't delete its configuration in web.xml. Because of this, it seems my web container was causing issues. Once I deleted that configuration I could see my JSP scripltes executing well.

Silly mistake but a good lesson to learn!

Thanks again!!!

Regards,
Himanshu
 
Arun Giridharan
Ranch Hand
Posts: 290
Debian Fedora Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
himanshu.harish agrawal wrote:

Thanks a lot!!! Yes, there were some issues in my web.xml; actually I configured a servlet in my web.xml but later I deleted that servlet but didn't delete its configuration in web.xml . Because of this, it seems my web container was causing issues. Once I deleted that configuration I could see my JSP scripltes executing well.

Regards,
Himanshu


If the servlet was deleted and not the configuration in web.xml it must give ClassNotFoundException , why it's not giving the exception ???
 
himanshu.harish agrawal
Ranch Hand
Posts: 47
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Arun Giridharan wrote:If the servlet was deleted and not the configuration in web.xml it must give ClassNotFoundException , why it's not giving the exception ???


Exactly, but only when you try to access that servlet, and luckily I didn't!

Regards,
Himanshu
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic