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

No output in jsp

 
Ranch Hand
Posts: 367
Eclipse IDE Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Hi ,
The below code doesn't show anything on the screen:

This index.jsp is under WebContent folder but outside WEB-INF.



It's web.xml : -



It's servlet pramod.java in default package :



Server log:


It does pring index.jsp's contents when there is no servlet (or when I don't write form<> tag) but otherwise there is an empty screen.
My main.jsp in WebContent outside WEB-INF contains "hihihh".

I'm not sure what we need to write in action parameter in index.jsp, is it the name of the servlet class, or something else.
I tried out writing 'pramod' , 'test' but no use.
Please advise.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Is there anything in the response being sent to the browser? Just looking at the browser display doesn't tell you much.
 
pramod talekar
Ranch Hand
Posts: 367
Eclipse IDE Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Hi Bear,

This is my main.jsp, I thought it would print at least hello

<body>

hello

<%= request.getAttribute("name") %>
</body>



So is

<form action="pramod" method="post">

right ?
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
You didn't answer my question.

And that does not match the code that you posted above. Why is that?

And why are you still putting scriptlets into JSPs 10 years after they've bee replaced with JSTL and EL?
 
pramod talekar
Ranch Hand
Posts: 367
Eclipse IDE Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
I didn't understand your first question on response in browser and made hhihh to hello to make it meaningful.
It's just for test purpose.

All I'expecting is index.jsp with 'hi' and 'go' button but even that is not appearing and the browser screen is plain white and there is no error in server log.
Also, not sure what I need to write in the Action parameter of the Form tag.
 
pramod talekar
Ranch Hand
Posts: 367
Eclipse IDE Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
I thought the response would contain at least 'hi' if not the 'go' button to the browser for index.jsp's execution.
 
pramod talekar
Ranch Hand
Posts: 367
Eclipse IDE Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
This project is not showing any output for any jsp now.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
You need to learn basic debugging if you are going to work in this area.

The View Source of the browser will show the body of the response as sent from the server.

Have you checked the logs for exceptions?

What else have you done to debug this?
 
pramod talekar
Ranch Hand
Posts: 367
Eclipse IDE Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
I did check the browser source code in Chrome which was blank.
Don't understand what is the problem with index.jsp excluding <form> tag.
Why can't it print even 'hi'.

I had also run debug on server option, same reply.

Could you please tell me if the action tag value is right or wrong.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
No, it's not. See your other thread. Closing this one.
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic