Wrox Programmer Forums
|
BOOK: Professional Java for Web Applications
This is the forum to discuss the Wrox book Professional Java for Web Applications by Nicholas S. Williams; ISBN: 978-1-118-65646-4
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Java for Web Applications section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 17th, 2017, 06:04 AM
Registered User
 
Join Date: Apr 2017
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Question Are these URLs considered different?

On page 48 of "Professional Java for Web Applications", author wrote 'mapped to different URLs" referring -
Code:
<servlet> 
    <servlet-name>oddsStore</servlet-name>
    <servlet-class>com.wrox.StoreServlet</servlet-class>
</servlet >
<servlet>
    <servlet-name>endsStore</servlet-name>
    <servlet-class>com.wrox.StoreServlet</servlet-class>
</servlet>
Don't they have the same class of servlet?
 
Old April 28th, 2017, 11:42 AM
Registered User
 
Join Date: Apr 2017
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

They are indeed the same class of Servlet.

When the author says mapped to different URLs he is referring to the following lines:

Code:
<servlet-mapping>
  <servlet-name>oddsStore</servlet-name>
  <url-pattern>/odds</url-pattern>
</servlet-mapping>
<servlet-mapping>
  <servlet-name>endsStore</servlet-name>
  <url-pattern>/ends</url-pattern>
</servlet-mapping>
The servlets named oddsStore and endsStore are instances of the same class - com.wrox.StoreServlet - but they are mapped to different urls through the url-pattern field above - /odds and /ends.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Relative URLs member4953 BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 4 May 15th, 2009 04:40 PM
Sending XHTML as text/html Considered Harmful skillmanp BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 3 August 3rd, 2005 12:37 PM
urls muhammadtahir4000 HTML Code Clinic 1 December 9th, 2004 04:41 AM
How Long Before We're Considered Inactive? Ben Horne Forum and Wrox.com Feedback 8 April 29th, 2004 10:55 AM
Automatic URLs Imar Forum and Wrox.com Feedback 13 June 19th, 2003 03:01 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.