This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSP and the fly likes not able to send data Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "not able to send data " Watch "not able to send data " New topic
Author

not able to send data

Nidhi Nagre
Ranch Hand

Joined: Nov 05, 2007
Posts: 64
hello there

i am not able to send data from an applet(embedded in a jsp) to another jsp even though i got successed making connection between these two.

i am using following code at applet side(embedded in jsp)



and this is at server side



but when i use std_details object for further implementation the i gets
java.lang.NullPointerException

here std_details is an properties object contains few key/value sets

any help would be much appriciated
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41046
    
  43
JSPs are meant for text, not binary data. While it's theoretically possible for them to send serialized objects, it's practically impossible to do this. Use a servlet instead.
[ November 07, 2007: Message edited by: Ulf Dittmer ]

Ping & DNS - my free Android networking tools app
Nidhi Nagre
Ranch Hand

Joined: Nov 05, 2007
Posts: 64
thanks Mr Ulf

but how much i know and of course you, that the jsp code is ultimately converted into its survlet coordinates.

then it must be possible to accomplish it with jsp as with servlets.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Originally posted by Nidhi Nagre:
thanks Mr Ulf

but how much i know and of course you, that the jsp code is ultimately converted into its survlet coordinates.

then it must be possible to accomplish it with jsp as with servlets.


Not necessarily.
The servlet code generated by JSP compilers contains code that inserts whitespace characters which corrupt an otherwise all binary output stream.
When used as directed, this is not a problem but when developers attempt to use JSP to perform tasks better suited to a servlet, it results in endless headaches.

Save yourself the headaches and do it the easy way from the start.
Use a servlet.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Nidhi Nagre
Ranch Hand

Joined: Nov 05, 2007
Posts: 64

Mr Ben Souther wrote

Not necessarily.
The servlet code generated by JSP compilers contains code that inserts whitespace characters which corrupt an otherwise all binary output stream.
When used as directed, this is not a problem but when developers attempt to use JSP to perform tasks better suited to a servlet, it results in endless headaches.



ok ,i understood
it would be better to use servlet, however might it be possible to redirect the datas sent to servlet towards jsp??

please help me with a suitable example

thanks again
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41046
    
  43
Originally posted by Nidhi Nagre:
however might it be possible to redirect the datas sent to servlet towards jsp?

I'm not quite sure what you're suggesting here, but if you want to stream objects, then no JSPs will (or can) be involved. As Ben asked, why are you resisting to use the right tool?

... that the jsp code is ultimately converted into its survlet coordinates.

then it must be possible to accomplish it with jsp as with servlets.

No. Just because everything that can be done in a JSP can also be done in a servlet, does not mean that everything that can be done in a servlet can also be done in a JSP. This is an example.
Nidhi Nagre
Ranch Hand

Joined: Nov 05, 2007
Posts: 64

Mr Ulf wrote:
I'm not quite sure what you're suggesting here


i was supposed to ask that, is it possible to redirect the datas sent to servlet(from an applet embedded in a jsp) towards another jsp?

ok i will move around your way.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60741
    
  65

Please read this article to see why a JSP is unsuitable for the task.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Nidhi Nagre
Ranch Hand

Joined: Nov 05, 2007
Posts: 64
well, now i want to explain whole of my problems scenario

at the start of my project, there are two jsp's and in which one of them is to prompt for the registration of candidates and another one is to display the feedback of that registration.

moreover, i have designed the registration jsp by embedding applets in it as gui and now i want that, after filling all the reqired fields when user clicks the submit button then he must get the feedback of what all he has entered.

now i am planing this accomplishment as firstly
1. i should post all datas to a servlet from registration jsp in the form of objects and then
2. after converting these to string datas ,redirect all these to feedback jsp.

am i going in a right way?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: not able to send data
 
Similar Threads
unexpected exception:please help
applet jsp communication
exception:please help
applet jsp communication
not able to communicate to servlet