If your file contains name=value pairs... you can use Resource Bundles for this
purpose. All resource bundles extend java.util.ResourceBundle. Refer Jason
Hunter's book for more details. The name should be a String and is the key.
Hth,
Manish Bhatnagar
Rema Kumar wrote:
> I have the following code in my doPost method, how do a get a parameter
> value from a file . Rather how do I read some value from my file into the
> parameter value.
>
> public void doPost (HttpServletRequest req, HttpServletResponse res)
> throws ServletException, IOException
> {
> try{
> // final String URLstr = HttpConnectionHelper.buildURL(req,
> "/PSUser/pstoc.htm");
>
> StringBuffer pubXConnString = new StringBuffer( "http://" );
> pubXConnString.append( req.getHeader( "HOST" ) );
> pubXConnString.append( "/PSUser/pstoc.htm?" );
> pubXConnString.append("NS_adv_search=0");
> pubXConnString.append("&NS_search_type=boolean");
>
> //Make configurable read from a file
> pubXConnString.append("&NS_collection=?????.... read from a
> file");
> ....
> .... and so forth
>
> }
>
> Any help in this regard will be highly appreciated. This is kind of urgent
> so pelase reply ASAP.
>
> Thanks in advance.
> Rema
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
--
---------------------------------Live-Your-Dream--------
Manish Bhatnagar
Software Engineer
Accord Software & Systems Pvt. Ltd.
37, Krishna Reddy Colony
Domlur Layout
Bangalore - 560 071
India
Telephone: +91-80-5560105 x 211
Fax: +91-80-5562723
Obstacles are things a person sees when he takes his eyes off his goal.
-E. Joseph Cossman
---------------------------------Live-Your-Dream--------
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html