Click to See Complete Forum and Search --> : Is Tomcat setup correctly?


tgrk35
06-15-2009, 12:25 PM
If I try to use jsp tags and they don't work at all... I have tried this:

<jsp:include page="includes/header.jsp"/>

It acts as if that isn't correct, doesn't include oracle info, messes up when attempting to connect to oracle.

Is there something wrong with my install? I didn't setup the server... not that I would know how, but I'm thinking something isn't right.

Ideas?

Thanks for all your help :)

criterion9
06-15-2009, 02:59 PM
Are you getting any error messages? Do you have the correct connection string for the Oracle server in question? Can the JSP server contact the Oracle server (network connection)?

tgrk35
06-15-2009, 03:07 PM
For some reason, I don't get any error messages. Like I mentioned above, I have never done ANYTHING with JSP before, I'm a PHP person.

If I do the <%@ include file="header.jsp" %> stuff, it connects to Oracle just fine.
The problem is within the JSP tag I guess.

Any ideas?

Thanks for your help.

criterion9
06-15-2009, 03:13 PM
What server are you using? Tomcat? Sun App Server? Glassfish?

Have you tried a basic tutorial of jsp to get your feet wet?

http://www.jsptut.com/
http://www.apl.jhu.edu/~hall/java/Servlet-Tutorial/
http://java.sun.com/products/jsp/docs.html

tgrk35
06-15-2009, 03:16 PM
Running Tomcat.

I've checked out the first link. That's where I got the idea I should be able to use JSP tags.

This third link looks slightly promising. I'll try some examples and let you know my findings.

After using this junk, it makes me realize just how simple PHP is... I thought I was smarter than I actually am I suppose ;p.

tgrk35
06-15-2009, 03:22 PM
Update:

Ok, I used THIS syntax instead:

<jsp:directive.include file="includes/header.jsp" />

It actually worked.

Thanks for the links and all the help :).

criterion9
06-15-2009, 03:51 PM
No problem. I haven't used jsp in awhile or I would've been more help. One thing to keep in mind when looking at those tutorials is that different version of Tomcat support different versions of JSP. I'm also thinking Tomcat is generally at least one full version behind other JSP containers. This was a stumbling block for me awhile back when I was translating a PHP application to a JSP container.

tgrk35
06-15-2009, 04:28 PM
That's kind of the same boat I am in mentally. Trying to figure out how I would do things in PHP, then translate over. Doesn't seem to work that way... either that or the dude that wrote this thing previously was simply an idiot. It's happened before I suppose.

criterion9
06-15-2009, 04:31 PM
I have found that most of the PHP code I run into is function based where JSP is almost always inherently OOP. It makes a huge difference when translating and sometimes it is a ton more efficient to restructure based off of use-cases or functionality instead of line-by-line translation. That will also allow you to take advantage of what each language does well and avoid what those languages do not do well.

JavaServlet
06-18-2009, 01:56 PM
I'm also thinking Tomcat is generally at least one full version behind other JSP containers.

Actually the latest version of Tomcat does offer alot as its own container compared to others except its just not a full J2EE with EJBs etc like WebLogic.
I am not a fan of PHP but I hear it does quite well for many people.