This discussion is archived
6 Replies Latest reply: Jul 26, 2010 6:01 AM by 843804 RSS

Use java project in a Web Application

843804 Newbie
Currently Being Moderated
Hello,

I need to use an old java project in a web application project.
The old project contains plenty of classes and methods but also a some graphical parts ( AWT ).
Do you think i should export it in a jar file and just reference it in the new Web application project ?
How will i call the graphical classes ?

Thanks a lot.
  • 1. Re: Use java project in a Web Application
    793415 Pro
    Currently Being Moderated
    Diddou wrote:
    ..I need to use an old java project in a web application project.
    The old project contains plenty of classes and methods but also a some graphical parts ( AWT ).
    By graphical parts do you mean a GUI? Is the GUI supposed to appear on the server or the client?
  • 2. Re: Use java project in a Web Application
    843804 Newbie
    Currently Being Moderated
    Thanks for your answer,yes i mean a GUI,it is supposed to appear on the server i think because only the administrator of the system can execute it.
  • 3. Re: Use java project in a Web Application
    793415 Pro
    Currently Being Moderated
    Diddou wrote:
    Thanks for your answer,yes i mean a GUI,it is supposed to appear on the server i think ..
    You think? This is becoming more confusing by the post.
    ..because only the administrator of the system can execute it.
    What does the app. actually do?
    ----------
    I was going to recommend Java Web Start for deploying it to end users of the web-app. But if it is only for the administrator on the server side, I'd tend to Jar up the resources, add a manifest specifying the main class, and give it to them not in a WAR.
  • 4. Re: Use java project in a Web Application
    843804 Newbie
    Currently Being Moderated
    Again,thanks a lot for your answer.
    I am really sorry,i have just started developing web apps,it's a little confusing right now but i am learning.
    The GUI component is supposed to help the administrator in the management of the survey's questions.
    The application is mainly supposed to display surveys to the clients and save their responses,only the administrator can view the results ad add new surveys.
    I also thought about a jar at first but the project contains also some methods that should run on the client side ( transfer questions to ArrayLists,save them in an XML,get them back... ).
    It's really complicated for a beginner.
  • 5. Re: Use java project in a Web Application
    gimbal2 Guru
    Currently Being Moderated
    I think you are attacking this problem from the wrong end. I think you should take the original requirements of the old application and rebuild it as a web application - trying to reuse the old code is only going to extend the amount of development time in my experience, especially because it was not developed with the web in mind. If you manage to somehow force parts of the old code base in, you'll probably end up with an unreadable and impossible to maintain mess.

    You say you are new to web development, this is going to be your learner project. Start fresh and implement each requirement of the application new. Based on what you have told about the application so far, that shouldn't be too difficult as a first time project.

    Good luck!
  • 6. Re: Use java project in a Web Application
    843804 Newbie
    Currently Being Moderated
    Thanks for your advice,that's what i decided to do with the GUI component,it's too hard to incorporate in the web project but can't i use the old simple methods ?
    Just export the old project in a jar and use it as a resource ?