Hi,
This is my function, and its pretty simple:
// the function returns logical path based on the calling path to the
servlet
// e.g. calling path=/jsp/ClaimDetails/displayClaimDetails.do, adaptPath =
displayClaimDetails
private String adaptServletPath ( String callingPath ) {
final String extention = ".do";
int firstIndex = callingPath.lastIndexOf ("/" )+1;
int lastIndex = callingPath.lastIndexOf ( extention );
if ( lastIndex == -1 ) lastIndex = callingPath.length ();
return callingPath.substring ( firstIndex, lastIndex );
}
Vadim Shun
NEW Corp
Dulles, VA
-----Original Message-----
From: Bailey, Jeff A [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 24, 2000 7:18 PM
Subject: Another even more trivial model 2 question
Well, I actually got the controller -> Action class model working
appropriately (Thanks to all those who answered all these trivial questions
of mine). . . .but I have another question.
What sort of methods are others out there using to obtain a "match part"
from the requestURI? I am ripping the string apart (in a very very poor
way) and reconstructing a "match part" by eliminating the server information
and virtual directory information used in the application deployment. I was
just wondering what some others have come up with because I am fairly
positive that mine sucks parts of the body that one should not mention on a
list such as this :).
This isn't anything urgent as I have everything working, I was just hoping
to see some alternative examples so I can see how mine stacks up (or
doesn't).
Thanks again for all the help to all who have contributed to the Model 2
discussion :)
-j
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets