The moose likes JSP and the fly likes No output in jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSP
Reply locked New topic
Author

No output in jsp

pramod talekar
Ranch Hand

Joined: Apr 26, 2010
Posts: 268

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.

Thanks,
Pramod
Bear Bibeault
Author and opinionated walrus
Marshal

Joined: Jan 10, 2002
Posts: 50693

Is there anything in the response being sent to the browser? Just looking at the browser display doesn't tell you much.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
pramod talekar
Ranch Hand

Joined: Apr 26, 2010
Posts: 268

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
Author and opinionated walrus
Marshal

Joined: Jan 10, 2002
Posts: 50693

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

Joined: Apr 26, 2010
Posts: 268

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

Joined: Apr 26, 2010
Posts: 268

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

Joined: Apr 26, 2010
Posts: 268

This project is not showing any output for any jsp now.
Bear Bibeault
Author and opinionated walrus
Marshal

Joined: Jan 10, 2002
Posts: 50693

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

Joined: Apr 26, 2010
Posts: 268

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
Author and opinionated walrus
Marshal

Joined: Jan 10, 2002
Posts: 50693

No, it's not. See your other thread. Closing this one.
 
 
subject: No output in jsp
 
Threads others viewed
Problem with Spring AOP
Frustrated with Eclipse !!!
please help me with my jsf pickle
Tomcat and apache configuration in debian
tomcat failed to initialize
IntelliJ Java IDE