• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

HF S&Jsp DiceRoller glitch

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey ,

Having a little trouble running the DiceRoller code (p389).

Coded the DiceRoller class, the TLD and the JSP as instructed, but I think
the problem may lie in the DD (p390 shows web.xml right there alongside
the TLD)

If there is no servlet involved and I need to call the JSP directly, what
should the DD contain?

I have tried inserting
in the place of
because I know that the jsp gets servlet status at some point.

Am I barking up the wrong tree guys?

The error I'm getting just says the jsp can't be found.
Hope you can help.

JJ
[ October 19, 2004: Message edited by: J Chandler ]
 
Cowgirl and Author
Posts: 1589
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Howdy JJ,
You're not barking up the wrong tree, and we should have made this much more clear.

The simple answer is that for testing, you can simply navigate directly to the JSP just as you would a static html page...

http://localhost:8080/SampleAll/TestBean.jsp

So, assuming you name your .jsp file "TestBean.jsp" and place it directly under webapps/SampleApp, you shouldn't have any trouble.

If you DO want to use a servlet mapping, which is almost certainly what you would want to do in the real world, then you *are* barking up the right tree, and you can do something in the DD like:

<servlet>
<servlet-name>doesnotmatter</servlet-name>
<jsp-file>/TestBean.jsp</jsp-file>
</servlet>

<servlet-mapping>
<servlet-name>doesnotmatter</servlet-name>
<url-pattern>/testIt.do</url-pattern>
</servlet-mapping>

Then if you use:

http://localhost:8080/SampleAll/testIt.do

This should take you to the JSP that uses the file name "TestBean.jsp".

At least I think I have that all straight... I haven't had enough coffee yet

cheers,
Kathy
 
J Chandler
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
well alright!

thanks Kathy
 
I knew I would regret that burrito. But this tiny ad has never caused regrets:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic