Running examples in j2ee tutorial update 4 of Sun Microsystem's tutorial pdf resource

I downloaded a zip file which contains all tutorial resources including source codes. My problem is that the tutorial assumed that the reader is using Sun's application server. I'm currently using Jboss 4.0.1sp1 as my application server and Im using eclipse 3.0.2 as my development environment. I'm really having difficulties running web application samples found in the resource tutorial.

1. How can I open web application samples found in Sun's "j2ee tutorial update 4" using eclipse 3.0.2 and be able to deploy it? I really need to experiment with the examples.

please help, im really having a hard time on j2ee development.
LVL 1
anthon007rAsked:
Who is Participating?
 
suprapto45Commented:
Hi,

Okay since you have this structure in your tutorial.

hello1
   build
      duke.waving.gif
      index.jsp
      reponse.jsp
      WEB-INF
        web.xml
   web
      duke.waving.gif
      index.jsp
      index.txt
      response.jsp
      response.txt

What you can do is that you need to copy the hello1 folder into your Eclipse workspace folder (c:/eclipse3/workspace/hello1). Then you need to go to File > Import > Existing project into Workspace then in the wizard, you need to choose which folder you want to import and what is the name of the project that you want to have and etc.

Now, I do not really know about JBoss but I think that JBoss (Web Server and not App Server) has no JSP/Servlet Container so JBoss itself will not be able to run JSP. You should downlaod the Tomcat in combination of JBoss to run JSP. Unless, you want to download the application server such as IBM WSAD or Bea WebLogic which are able to execute JSP as well as J2EE things (JBoss). I can tell you how to run the application in Tomcat.

Regards
Dave
0
 
suprapto45Commented:
Hi,

I am thinking that you need to create a new J2EE project on your Eclipse, then you need to copy manually all the JSP, HTML, images and .java files to the appropriate folder. It is something like you are assembling the sample in the Eclipse and JBoss instead of Sun App Server. Do not forget to copy all the jar files too.

Then for the deployment, I think that Eclipse created it automatically, if not, you need to configure your build.xml (Ant) by yourself.

I hope that helps.

Regards
Dave
0
 
suprapto45Commented:
Alternatively,

If the sample provides .war file, you can import it in your Eclipse. Or you might want to import all the files after you unzip it into your Eclipse.

Regards
Dave
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
anthon007rAuthor Commented:
how about those xml files? should i copy them too if creating new j2ee projects in eclipse generates some xml files and let the sample's xml files overwrite xml files generated by eclipse?
0
 
anthon007rAuthor Commented:
Im also having problems where to put folders and files to corresponding correct folder
0
 
anthon007rAuthor Commented:
like for example,
in eclipse IDE, creating a j2ee web application generates this file system structure:

hello1*
  src
  JRE System Library
  j2ee 1.4 library container
  WebRoot
    META-INF
      MANIFEST.MF
    WEB-INF
      lib
      web.xml

*assuming i named the project as "hello1"

while the "hello1" sample found on tutorial resource have this file system structure

hello1
   build
      duke.waving.gif
      index.jsp
      reponse.jsp
      WEB-INF
        web.xml
   web
      duke.waving.gif
      index.jsp
      index.txt
      response.jsp
      response.txt
     
I really don't know where to put what. My first attempt is to create a "web" folder on web project and copy-paste all the contents from web folder of sample application from the tutorial and got at least 6 errors.

It's really a headache :(
0
 
anthon007rAuthor Commented:
I don't thinks it's easy as copy-pasting
0
 
suprapto45Commented:
Yes,

It is a headache. Normally, if it is a Sun App Server example, you should use Sun App Server. Are you sure that the sample is only in Sun App Server?

I will try to anwer your above questions soon

Regards
Dave
0
 
anthon007rAuthor Commented:
Im not sure if I should really use Sun App Server.. but in my opinion, it should not be the case.. what if the I want to switch to different app server? Isn't very inconvenient for the developer to rewrite again? Im not so sure because im really a beginner here in J2ee.. but anyways, I really appreciate your effort for helping me.
0
 
suprapto45Commented:
Hi,

>>"Isn't very inconvenient for the developer to rewrite again"
Yes, normally, after we finished creating the J2EE web application, we created .WAR file so that it would be fit to other app server. it is like we bundle all the application into 1 portable file. However, if your Sun App server sample has no .war file (instead all the JSP, HTML, .java and etc), it would be hard for us to switch app server since you need to copy manually.

Regards
Dave

0
 
suprapto45Commented:
>> " im really a beginner here in J2ee.."
Any experts in the world came from beginner :)

Regards
Dave
0
 
suprapto45Commented:
Hi,

As J2EE Beginner, I strongly recommend you to read the threads below.

http://www.experts-exchange.com/Programming/Programming_Languages/Java/Q_21396857.html

then

http://www.experts-exchange.com/Web/Q_21399150.html

Regards
Dave
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.