• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

program for displaying request details

 
Sudarshan Sreenivasan
Ranch Hand
Posts: 188
IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi i have written code intended to display the request messeage sent by the client to the server .... however i,am not getting the required output !! ... can you please tell me where i am going wrong

 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You overrode the service method, huh? Interesting.

Usually it's helpful to tell people what response you expected and what you actually received instead of simply saying it isn't correct.
 
Sudarshan Sreenivasan
Ranch Hand
Posts: 188
IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hii
I overrode the service() mehtod just to see if that was possible ... i still learining so was curious about the possibilities !

The output i am looking for is the request message sent by the client to the server which may include the headers,any parameters (for eg values in text-fields) ,date,request line and so on !!

The output i,am getting is

TextBoxContents DoPost Inside while org.apache.catalina.connector.CoyoteInputStream@9c2715 No of bytes read -1 The method type is POST

Now the confusion is how come (No of bytes read -1) ??? what this indrirectly implies is that the request object does not have any data ....

I hope i have framed my question better this time !

Thanks


 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Now the confusion is how come (No of bytes read -1) ??? what this indrirectly implies is that the request object does not have any data ....

Please check the API.
[ July 22, 2007: Message edited by: Christophe Verre ]
 
Sudarshan Sreenivasan
Ranch Hand
Posts: 188
IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
i did check the api .... my dout was more on the lines of why my program fails to display the contents of the request object (date header , request line , body of the request etc )on the screen ??

and if possible can you provide me with a code sniplet which shows how to display the contents of the request object .... (the contents of the request the client sends to the server)

Thanks
 
Sudarshan Sreenivasan
Ranch Hand
Posts: 188
IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please consider the following code snipley




this implies that my request object is not holdiong any data ?? How is this possible ?? However i get the length as a value above zero (depebding on the parameter passed)

I am also showing the html page i use to call this servlet ... hopefully this gives any clues to such wierd behaviour !!




Please someone help me !!!
Thanks
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, but what you are asking is not clear. Your form action is a POST, and you're showing us a doGet method. Please clarify.
 
Sudarshan Sreenivasan
Ranch Hand
Posts: 188
IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator




Even with this code ... i dont get the desired output ie contents of the request object !!
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have a look at the javadocs for ServletRequest.getParameter. It contains the answer to your question.
 
Sudarshan Sreenivasan
Ranch Hand
Posts: 188
IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sheriff i salute you !!! Thanks alot !!! ... Sorry for the silly mistakes i made while posting my question !!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic