"Kumar, Ashutosh(sdc)" wrote:
>
> Hi All
>
> To invoke a servlet from jsp , I need to give url as
> /WebappPath/servlet/package name.servlet name in WebSphere app server.
> This WebAppPath ,I dont want to hard code in my JSPs.
> So I am thinking to read this WebAppPath from a property file of JSP to
> avoid hard coding in JSP.
> How to do that, pl. guide me.(If possible , particular to WebSphere/Visual
> age).
> If any other solution possible apart from property file , pl. let me know.

Standard configuration for JSPs and servlets is WEB-INF/web.xml file.
There, you can put all your configuration data and inside a servlet (JSP
too as at the end it's a servlet), you are only required to call
HttpServlet.getInitParameter(String name) to receive a value of a
parameter. It's simple and *portable* across 2.2 compilant servlet
engines.

 <servlet servlet-name='myJSPpage'
          jsp-file='/myfirst.jsp'>
     <init-param param1='value1'/>
     <init-param param2='value2'/>
 </servlet>

Take a look at the servlet container's documentation.

> * Ashutosh Kumar

Jacek Laskowski

===========================================================================
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

Reply via email to