aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes url-pattern example Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "url-pattern example" Watch "url-pattern example" New topic
Author

url-pattern example

Amruth Puppala
Ranch Hand

Joined: Jul 14, 2008
Posts: 295
Source of question is www.examulator.com mock

Given that a servlet is correctly declared with the tag

<servlet>
<servlet-name>HelloWorld</servlet-name>
<servlet-class>com.examulator.HelloWorld</servlet-class>
</servlet>
Which of the following represent the correct syntax for mapping a servlet url to a servlet name

a)
<servlet-mapping>
<servlet-name>HelloWorld</servlet-name>
<url-pattern>hello</url-pattern>
</servlet-mapping>

b)
<servlet-mapping>
<servlet-name>HelloWorld</servlet-name>
<url-pattern>*.java</url-pattern>
</servlet-mapping>

c)
<servlet-mapping>
<servlet-name>HelloWorld</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>

d)
<servlet-mapping>
<servlet-name>HelloWorld</servlet-name>
<url-pattern>/com.examulator.HelloWorld</url-pattern>
</servlet-mapping>



which are correct.


SCJP 5 |SCWCD 5| Started thinking about Web Services ?
Michael Ku
Ranch Hand

Joined: Apr 20, 2002
Posts: 510
Which do you think is correct and why?
Bala'J'i Rags
Greenhorn

Joined: Jul 29, 2008
Posts: 26
Hi chintu ,

My options are b,c,d

b- extension match

d- is an examples for exact match

c-is similar to default macth when we say /*


Please correct me if iam worng
[ August 19, 2008: Message edited by: Bala'J'i Rags ]

SCJP 1.5,SCWCD 1.5
Bala'J'i
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: url-pattern example