it is all in the deployment descriptors...
first web.xml
the relevent parts.... first to map the servlet....
<servlet>
<servlet-name>hello</servlet-name>
<servlet-class>simple.helloServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>hello</servlet-name>
<url-pattern>/hello</url-pattern>
</servlet-mapping>
this names out helloServlet.class hello, then maps ALL calls to /hello to
that servlet
so http://localhost:8080/hello results in a call to the helloServlet.class.
now...
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
tells us that our welcome files... most people think of index.html as being
the welcome file....
the welcome file is index.jsp. so... IF we had a directory hello that
contained index.jsp then
http://localhost:8080/hello/ would result in that index.jsp showing.
however.... we dont have that directory.
now the application.xml
first we need to tell about our web application
<module>
<web>
<web-uri>webapp.war</web-uri>
<context-root>/</context-root>
</web>
</module>
here we map this web application to /
so a call to http://localhost:8080/ will result in our index.jsp showing.
if you want to map to hello then change the <context-root>/</context-root>
to
<context-root>/hello</context-root>
then to see JUST the servlet you would call it like this....
http://localhost:8080/hello/hello
and to see the index.jsp you would call
http://localhost:8080/hello/
Hope that clears up some things.
Al
----- Original Message -----
From: Richard Bottoms <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, June 20, 2001 5:26 PM
Subject: Re: [JBoss-user] Please, please , please
> At 01:33 PM 6/20/01 -0700, you wrote:
> >How could there be a simpler HelloWorld ?? :) :)
>
>
> It's not just the code compiling, it's understanding how the thing works.
>
> For instance I now know that I don't need to manually change the
server.xml
> file to deploy applications. But I still don't know why /hello works, and
> hello/ or /hello/index.jsp does not.
>
> A tar'd example with all the directories in place eliminates mistakes of
> directory structure and shows the requirement to get <servlet>.class into
> WEB-INF/classes. But, I still don't know if there is a way to undeploy an
> app in the same way that all needed files are deployed. Seems like an
> application server would have a remove feature in place or on the
> improvements list.
>
> When I first started using Apache to manage sites I was just as lost in
the
> beginning. But, the docs on Apache covered every single line in
httpd.conf.
> Once I got the server up I could experiment with what would break/improve
it.
>
> As I mentioned in an earlier post, I would love to learn every quirk and
> optimization in JBoss-Tomcat. But, what I really need is to get it to
serve
> up pages right now, which is 25% of what I need to accomplish.
>
> A JDBC-MySQL 'hello world' would solve another %25 of what I need.
>
> How about a 'hello-world' for sending email?
>
> Last, a How-to on hot-swapping applications would be good. I need to know
> if I can send people to an error page if an app has been removed for
> instance? I'm sure this info is in docs or newsgroups some where but I
> don't always have time for marathon learning binges.
>
> Many folks just need a webserver/app server to out send out HTML, merge
> data, maintain apps, and send email. Four 'hello-world' examples and were
> happy.
>
> Why it works is a matter for another time. Just give beginners examples
> that work with a completely vanilla install and we can improve our
> knowledge over time.
>
> How this benefits the creators of JBoss is we can roll out JBoss Apps on
> just about anything that will run Apache. That starts to make JBoss
> ubiquitous and opens the door to high level consulting and EJB component
> libraries.
>
> Hell I'd pay now for a 1-2-3 setup for a MySQL/JDBC connectivity EJB
> installer. It's trading 'work right now' for time to learn later.
>
> As a matter of fact some of my partners are kicking around the idea of a
> stripped down Red Hat distro that comes up with Apache, MySQL JDBC,
> JBoss-Tomcat and management console ready to go. Just add Sun's JDK/JSDK.
>
> I'm running my tests on a Pentium 166 with 32 megs of RAM. It's a junker
> machine, but everything works just fine. Can you imagine providing
> WebLogic-like functionality to webmasters in a $50 package that will run
on
> anything?
>
> Thanks for all the help and on behalf of the newbies, I swear I'll reach
> back and help once I've got the hang of things.
>
>
> r.b.
>
>
>
>
>
>
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/jboss-user
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user