• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

not able to send data

 
Nidhi Nagre
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Nidhi Nagre
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Nidhi Nagre
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Pie
Posts: 64833
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please read this article to see why a JSP is unsuitable for the task.
 
Nidhi Nagre
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic