Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Progression from JSP to J2EE? 1

Status
Not open for further replies.

fedtrain

Instructor
Jun 23, 2004
142
0
0
US
Hello all,
This little text to html project I agreed to has turned into a monster..not sure if it's a nightmare yet. I have years of experience with DreamWeaver and WYSIWIG's. But this project has changed since I agreed to it.

We are conveting paper forms to online forms. I have been wading through javascript for the last week to get the form fields and submissions to do what we need.

This just builds the prototype.

The next step is to move the forms to our J2EE servers in a Websphere environment.

Currently I know nothing about J2EE and have a week's worth of javascript under my belt.
Am I headed in the right direction?
Is this all basically a form of Java so it will all play together?
What are some roadblocks I need to know about?

Thanks
Dave (who is at the mercy of bosses that think trainers should be able to program...)


"Credit belongs to the man who is actually in the arena - T.Roosevelt
 
Ok,
Must be a bad question. How about this one...."If I design a site using a lot of javascript for form validation and print format...will I have any issues loading(converting?) it to J2EE?

Dave (who isn't having much luck figuring this out...)

"Credit belongs to the man who is actually in the arena - T.Roosevelt
 
Depends on how good you rcore Java skills are. J2EE should not be attempted by those without (IMO) at least 1-2 years solid Java development, as it just causes problems. It is by no means an easy technology to use, especially for the beginner.

If you have only one weeks javascript (not the same as Java) experience, I'd say you would be insane to look at J2EE.

On another note, J2EE is not really the technology to use for form validation anyway. J2EE is for large scale distributed applications and uses technolgies such as EJB, JMS etc that need to operate against enterprise level datasources (usually a database such as Oracle or SQL Server).

Servlets and JSP (technically classified as one part of J2EE, though not requiring the same skill level as other core J2EE technologies) are more suitable for form validation, though if you were just using servlets/JSP I would certainly not use a J2EE server such as JBoss, WEblogic or Websphere to serve them, as these servers will just provbide an overhead and complexity not required for simple form processing.

If you have no Jva experience at all, I would forget about J2EE and/or servlets/JSP altogether and put some time into learning the core Java edition (J2SE) -there are lots of tutorials at
--------------------------------------------------
Free Database Connection Pooling Software
 
Well that is kind of a scary answer. The problem is that the whole system has now been converted to Websphere with J2EE servers(?). So, we are having to re-assess what we have currently and what we need in the future. (No more coldfusion or PHP's.)

This form is just the first part of the project. In the future it has to be upgraded to interact with databases and serve up customized options based on login.

So, I have started this form with all JSP's. I am not attempting any server side stuff at all in the first iteration. (Basically we just want to force them to type in the info before printing it...handwritten was too messy.) The next iteration is where we have to worry about all the server stuff.

Right now, this basic form just has to live on a J2EE server with out blowing up. Is that more possible than me learning 2 years of java in the next month?

Dave

"Credit belongs to the man who is actually in the arena - T.Roosevelt
 
It's time people got the idiotic notion that J2EE == EJB out of their heads.

JSP and Servlets ARE J2EE. Depending on your requirements a full blown J2EE application server may well be required (JNDI, JMS, etc. etc. are also part of J2EE).
 
jwenting :

At no point did I say J2EE == EJB.

I also realise that the servlet api is technically classified as J2EE (as per my previous post), but I don't really believe it is part of J2EE full-blown. The skillset required to fully understand JMS or EJB is far greater than that of JSP - which is why I count them differently.
For example, tomcat serves JSP/Servlets but is NOT a J2EE server - it is a servlet container. As for definitions, I would count JDBC as J2EE, but it is technically J2SE.

Finally, if the OP is just doing form validation with a bit of JDBC down the line, he/she will never need a J2EE server - and saying they will is just muddying the waters.

--------------------------------------------------
Free Database Connection Pooling Software
 
fedtrain :

Why pay for a Websphere server when Tomcat will server your JSp/Servlets, and also allow JDBC interaction for free ?!

Whether or not you can learn JSP in a month is too vague for me to answer. It depends on your skill set, how hard you work etc etc.

But IMHO adding websphere into the equation is just making things harder. Keep it lightweight, take a JSP and Tomcat tutorial and dig in ...


Good luck - we're here when you have problems !

--------------------------------------------------
Free Database Connection Pooling Software
 
Thanks for the input.
Unfortunatly when dealing with a national orginization, somone else is making the decisions about the servers. This is the only space we can use, so we have to comply with what is there.
(Also, these servers are not only dealing with my content, the are also serving many other security, info, and logging duties...)

Dave (who is glad to hear that learning JSP first is not the wrong thing to do...)

"Credit belongs to the man who is actually in the arena - T.Roosevelt
 
Oh well ... in that case take the JSP tutorial, and try not to get dragged down by Websphere deployment configurations too much.

If I were you, I'd still learn JSP running under tomcat, because when you build your webapp into a .war file - it will deploy just the same onto websphere when you are ready to, but will mean you can run tomcat locally on your development machine during the learning process. I promise it will simplify matters !

--------------------------------------------------
Free Database Connection Pooling Software
 
To build a forum in a simpler approach with faster response time, you need html, JavaScript, JSP, JavaBeans, Servlet, JDBC.

You will use IBM Websphere Application Developer tools to config the server and deploy the web component(war).
I suggested you use Websphere Enterprise Version if you can get them. It is a newer version of Websphere and it has more complete set of functions.

I learn jsp and JavaBeans from using Tomcat and I am using weblogic 8 now.

Using very simple jsp and servlet as examples and learn how to deploy jsp and web components on Webphere.

I think you do not need EJB for making a forum but you can read some introduction about EJB.
 
fedtrain:

The thing to take note of is that even if J2EE contains a lot of technologies (EJB, JSP, Servlets, JNDI, etc.), you don't have to use all of them to take advantage of J2EE.

You can do your project in phases to coincide with you and your team's growing familiarity with JSP/servlet development. The first steps below don't even use jsps or servlets. You can use them in a later phase when you're more familiar with them.

One of The easiest things you can do is to convert your existing web project into a war-compliant web project. All this means is that you follow a simple directory and naming structure:

Code:
<main web directory>
  |
  +--WEB-INF
       |
       +--classes
       +--lib

Inside the WEB-INF directory, create a file named web.xml with the following contents:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "[URL unfurl="true"]http://java.sun.com/dtd/web-app_2_3.dtd">[/URL]
<web-app>
    <session-config>
        <session-timeout>30</session-timeout>
    </session-config>
    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
        <welcome-file>index.html</welcome-file>
        <welcome-file>index.htm</welcome-file>
    </welcome-file-list>
</web-app>

The welcome file just says what page to display when the website is accessed.

From this point on, you can put additional sub directories in the main web directory to put in your images, scripts, etc. You can put your existing pages in the main web directory as well.

Next is to create a war file from the project. A war file is just a zip file of the main web project directory. Its usually named as <web project name>.war.

Next, try to deploy this war file to a servlet compatible webserver like tomcat or websphere. After deployment, you can test out your website. It should be the same as the old project.
 
Why hasn't anyone mentioned Struts. Having a beginner write servlet/jsp without struts will leave that code an absolute mess. Learning struts at the same time as java will not add very much time to the project and will help enforce MVC which Dave will be grateful for when the time comes to add functionality to the application.

just a thought
 
dw12345 :

In your opinion ...

(BTW, Struts follows MVC2, not MVC - they are two very different models.)

Another view is that without a decent knowledge of JSP & servlets, learning Struts will cause more problems than it attempts to solve. For a small project, Struts is often an over-engineered solution and not worth it. Don't always believe what you read - frameworks are certainly not always the best way to go !



--------------------------------------------------
Free Database Connection Pooling Software
 
sedj

I did not get this opinion from reading about but from having to deal with new java programmers writing jsp that are 100's of lines and servlets that try to do it all and I have found struts to be the best way for me to deal with it.

The learning curve for struts in a small project is almost nil and will also teach OO at the same time. The smaller the better for a learning situation.

(btw mvc/mvc2 who cares you got my point)
 
>>>>> (btw mvc/mvc2 who cares you got my point)

Ermm... MVC & MVC2 are completely different ...

If you feel Struts is the correct methodology for you, then that is great ... thats you opinion.

Another opinion is that it can be a bloated framework that involves far too much CPU processing time & developer time than actually benefits the project.

I'm not saying that MVC2 & Struts are per se a bad idea - just that its not always the best solution.

If you cannot see both sides, then that is your loss !





--------------------------------------------------
Free Database Connection Pooling Software
 
Hey all,
I've been hanging out on the JS board and missed parts of this conversation....Good input though.

Struts are ????

(Just asking incase someone mentions them again.)

Thanks
Dave

"Credit belongs to the man who is actually in the arena - T.Roosevelt
 
Struts is an open source "framework" for building web applications and the like in a certain way. Web development can be messy at the best of times, and following a framework like struts can help separate logic from interface and processing. Read more at

Basically, in laymans terms, a model view control structure (like Struts, whether MVC or MVC2) is this: A central servlet or set of servlets processing many web requests, with conceptually separate business logic and interface. Its complex, but generally in the long run it saves time because business logic, interface and the like are not so intertwined and maintenance and upgrades become alot easier.

Seriously tho, this is a little over the top for the things you are trying to do. I would suggest from what I know of your project to get a really good JSP and Servlets book and just concentrate on the basics; like getting the form to submit to a servlet first.

Your managers really must be nuts tho if they are getting trainers to program in J2EE, as someone mentioned this is a job for someone with 2-3 years experience. It just goes to show how undervalued IT is in some businesses - particularly developers; this could cost them alot of money in the future if Things Go Wrong or Change Alot. This is the "he knows about computers" syndrome I get alot - "he knows about computers, get him to change the motherboard/harddrive/upgrade the kernal (when all he knows is a bit of Excel)" I've found in alot of (especially small) companies.

I am wondering, perhaps someone could suggest to him some arguments for getting this done properly. We all know the concequences of a badly started project, but put in fast economic terms a good financial argument could shock the management into realising the error of their ways? Even if it doesnt dissuade them from using his resource, at least he might be able to persuade them to send him on a course?
 
The reason I suggested struts was because Dave said:
*************
This form is just the first part of the project. In the future it has to be upgraded to interact with databases and serve up customized options based on login.
*************

I believe maintenance and echancments are a huge pain when jsp\servlets are used. Alot of struts tutorials start out with a simple user/password application which is similar to the application being written by Dave which would lessen the learning curve.

However if Dave is just getting this started and will be able to pass it off to an experienced developer jsp/servlets probably make more sense.
 
If you're writing JSPs you can honestly tell your managers you're using J2EE so you're covered if they attack you in a bout of company politics.

As to Struts, as said it's often an overly complex solution (just as EJB are).
If you do want to use a framework to base your application on, there are lightweight solutions like Spring available or you can roll your own.

We elected to do the latter in part because of requirements, in part because the decision was made by people with no in-depth knowledge of what was available and in (probably a large) part out of vanity.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top