• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Apache Tomcat 5.0 woes.

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Folks-

I have put Tomcat 5.0.24 on Fedora Core 1. All the the examples work,
I even download the O'Reilly book jspbook3.zip files from the JavaServer Pages book. These examples work well.

I created a sub directory, /usr/local/tomcat5.0/webapps/myApp
with /WEB-INF/web.xml

web.xml below
--------------
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "
<web-app xmlns="http://java.sun.comxml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/h233 http://java.sun.com/xmlj2ee/web-app_2_4.xsd" version="2.4">

<display-name>TEST JSP!</display-name>
<description>First JSP Thang</description>
<servlet>
<servlet-name>test_jsp</servlet>
<servlet-class>test_jsp</servlet>
<servlet-mapping>
<servlet-name>test</servlet>
<url-pattern>/test.jsp</url-pattern>
</servlet-mapping>
</web-app>

....My jsp file is nothing more then

<html>
<head>
<title>test jsp</title>
</head>
<body>
1 + 1 is: ${1 + 1}

</body>
</html>

-----

I copied this file into the Tomcat $CATALINA_HOME/webapps/ROOT/test.jsp

and it works, but it renders: 1 + 1 is: ${1 + 1}

I thought perhaps I missed something so I copied the example from the
Tomcat Distribution jsp2.0 (basic-arithmetic.jsp) it does the same thing.

so...to my question

a) given any simple jsp (not jdbc etc yet &^) How do I configure a new
application (for example myApp directory)

I presume that I missing a few things here. Any help would be appreciated,
but I am looking for Knowledge Transfer.

Thanks in advance, I have spent the last week doing web searches, looking
through books and I still haven't got it...

Sincerely,

Stephen L. Hathorne
slh@rdi.net
 
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
two questions:

1) Why are you configuring anything in web.xml ? Your JSP page ought to be recognized 'as is', without a mapping.

2) What is ${1 + 1} ? Is it EL ? Can EL be like that in the newest JSP spec? (just all by itself, alone without any EL imports of any kind?)

Just for the heck of it, does a jsp page work like this:

$CATALINA_HOME/webapps/ROOT/foo.jsp

<html>
<body>
<%= "Hello World" %>
</body>
</html>
 
It wasn't my idea to go to some crazy nightclub in the middle of nowhere. I just wanted to stay home and cuddle with this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic