Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP that converts office extensions to pdf and then upload them

 
Thiago Balducci
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there !

Im trying to convert office extensions ( .xls, .ppt, etc) to pdf and then upload the resulting file to a server .

currectly im using the upload solution using o'really, upload commons and java beans
and as for the conversion im using a solution which uses OpenOffice's lib to do the conversion.I'm going to post the codes of my JSP and my HTML ( which just contains the form to get the file to be converted and uploaded).

observation: the point which is giving me headaches is how to get the file sent by my form, convert it into a File object, use my conversion tool and then deliver it to my upload tool so it can be stored.... i cant seem to get the File object from the request object ( tried getattribute and it returns null....) .

observation':I do know about and how to use MVC but my boss asked me to make this work with just one JSP or a JSP and a HTML.

index.html :

Conversion.jsp :

upload portion:

conversion portion:



Both work just ok when separated but i cant get both to work together....

Any help is much appreciated!!!

Thanks in advance
 
Ankit Garg
Sheriff
Posts: 9521
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
my boss asked me to make this work with just one JSP

IMHO, you should ask your boss to change his requirement. Converting the file type is pure programming logic. Putting programming code in JSP is not a good idea. You should use a Servlet to do the work for you. An HTML page can submit the request (with the .xls or whatever file) to the Servlet, and the Servlet will do the conversion. Also you cannot convert the file in the browser, the JSP code executes on the server, so you can't convert and then upload the file. You can convert it on the server side after uploading...
 
Thiago Balducci
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ankit Garg wrote:
my boss asked me to make this work with just one JSP

IMHO, you should ask your boss to change his requirement. Converting the file type is pure programming logic. Putting programming code in JSP is not a good idea. You should use a Servlet to do the work for you. An HTML page can submit the request (with the .xls or whatever file) to the Servlet, and the Servlet will do the conversion. Also you cannot convert the file in the browser, the JSP code executes on the server, so you can't convert and then upload the file. You can convert it on the server side after uploading...



yeah, i thought the same thing, i warned him about doing all this with just a JSP but he said it were to be done that way anyway.... x.x



thanks for your reply !
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic