开发者

can i use java code as it is in a jsp file?

Please forgive me if my question sounds too dumb :(... I have created a java desktop application, which has a single UI screen in Swing... The application creates a pdf report... I want to convert this application 开发者_开发问答into a jsp based web application. So do I just have to create a simple screen where the parameters required to create the report are asked, this screen replaces the swing based UI... and the main block of java code (used to create the report with the help of input parameters) can be invoked from a jsp file? Is that it? Or is something more significant required to make this app into a web app. How do I find out what else is required?


You should have a web server. Create a web archive (.war) from your code base by reusing Java classes and new jsp file (UI). So your understanding is correct. and remember there won't be any main method now.


Yes - JavaSE code is the same Java on server side. You have to change UI. You may use plain HTML or web framework such as JSF.


This highly depends on your code. Business logic and PDF generation might be reused but the UI will definitely be replaced. You'd then also have to account for the download part, i.e. the response could be a page with the DL link or the generated PDF.

Edit: as Azodious already stated, you'd need a webserver like Tomcat (or JBoss which is a fully fledged application server and includes Tomcat) that is able to execute the Javacode, so just replacing the UI wouldn't help much.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜