• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Connecting into JSP from J2ME

 
Stephen Hanley
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using the following code to output a string as a JSP to be read into my J2ME midlet.


It throws an exception due to the output stream having already be called. This isn't really a problem but it is messy.

Also when I test this in firefox the string comes up with four little boxes in front of it. I cannot read the String into my midlet either. it calls the url alright but can't read the reply.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A Midlet can't call a JSP Page, but it can call a Servlet. Just create a Servlet with the exact same code, and have your Midlet call that instead.

Mark
 
Stephen Hanley
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The JSP imports HttpServletRequest/Response.

Is this the same thing?

It creates the EJB etc. I just can't decipher the response due the weird stuff at start of stream.

I can read the string from the diagnostics of the Nokia Series 40 Developer SDK.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But a JSP page is converted into a Servlet, but you won't know the name that it will give it.

Just make the Servlet yourself, and you will know the name and interface, and then it is much simpler. Just return a String of the information you want back. It can be XML if it is complicated data.

Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic