Re: where can I get org.apache.commons pckg..
maya wrote:
[T]hank you Roedy.. [A]ctually, what I'm trying to do is learn how to make a
servlet comm[unicate] w[ith] a JSP.. [I]n [a] JSP/servl[et] cookbook is a recipe, but it uses
this org.apache.commons package [?] .. [I]s there a way to do this
(w[ith ]requestDispatcher [sic], etc..) w[ith]o[ut] [a] 3rd party API?
[T]hank you very much..
A JSP is a servlet. When programming servlets and JSPs, one does not
(usually) have servlets act as HTTP clients to other servlets. They either
transfer control directly, using the standard Java EE API, or they redirect
the client (i.e., the browser). HttpClient is the wrong way to go.
If the servlets (i.e., JSPs and Java-source servlets) are on the same host in
the same application, then 'RequestDispatcher' (not "requestDispatcher") is
the right way to go.
<http://java.sun.com/javaee/6/docs/api/javax/servlet/RequestDispatcher.html>
If the forward or include is to another servlet (JSP or Java source) on the
same host, you need
<http://java.sun.com/javaee/6/docs/api/javax/servlet/ServletContext.html#getContext(java.lang.String)>
first, then
<http://java.sun.com/javaee/6/docs/api/javax/servlet/ServletContext.html#getRequestDispatcher(java.lang.String)>
on the resultant 'ServletContext' in order to get the right 'RequestDispatcher'.
Your idiosyncratic punctuation, (lack of) capitalization and excessive
abbreviation make your posts somewhat difficult to read. It's not all that
hard to type words out to make life easier on those reading your posts.
--
Lew