• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sending images to a midlet.

 
Tonny Tssagovic
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello people,
What is the best way to send some binary data (images) to a J2me client? JSP's r no good for this, so one should use servlets, which makes it look more like a Controller and VIew at the same time. Do you send it using s helper function? what is the best architecture in the server side, in case you need to send images and text (like to a micro browser) .. link to images ?(too slow with network latency, first get the link.. then download the image..)??
Any help will be appreciated..
Thanks a lot.
 
Tonny Tssagovic
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Come on guys, help me out :roll:
 
selva rajan
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
r u kidding?
 
Tonny Tssagovic
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why selva? I don't understand, I am serious, just wanted to get some help/comments.
 
Orika Akawana
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
because of question
1000 solutions depends on your needs. give more requirements specification. But first take a look on this article:
http://www-106.ibm.com/developerworks/java/library/j-j2me4/
JSP, servlets, php and so on... your choice.
 
Tonny Tssagovic
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the answer.. I already know about the article..
My neads.. Well just general architecture based on Servlets, and how to decouple the image scaling/sending from this controller servlet.
thanks
 
Orika Akawana
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Create a servlet. Map it on "/giveMeMyImage" and do all what you want incide the servlet body. Use JMF if you need image effects. Scaling can be performed without JMF.
This is not architecture, this is simple servlet mapping If you need more info on MVC just search google.
 
Orika Akawana
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in general... forget about MVC (it is just a words combination) . Here, (you know how to create a simple server application and web.xml file which configures your web-app)... so, some where in your web.xml:

I use RESIN as web app and ejb server. You can use tomcat (for ex.). Tomcat mapping will be a bit different (look on docs). So, now if you will make any http requests on your server "http://www.xxx.com/control/" which are ended with "/control/" they will be handled by your MainServlet. The servlet has some methods like doGet doPost and so on... Isert your code in doGet method (read docs why). This code should load, process and send image to the client (look for code in the article i have post). TO use the power of MVC you need "requests mapping manager". Take a look on apache.org. They provide something... I use my own which was wtitten 3y ago and works fine for me
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic