Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HF S&Jsp DiceRoller glitch

 
J Chandler
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • 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 ]
 
Kathy Sierra
Cowgirl and Author
Rancher
Posts: 1589
5
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
well alright!

thanks Kathy
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic