• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

How will i pass the SubjectofIssuePath in File fin=new File();

 
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Sir,
I am reading this file from properties file and now SubjectofIssuePath
display the correct path.
SubjectofIssuePath = bundle.getString("SubjectofIssue");
out.println("SubjectofIssuePath"+SubjectofIssuePath);//http://127.0.0.1:81/help/Subject of Issue.txt

Sir my doubt is when i pass SubjectofIssuePath here is it is not displaying any value.But if i hardcoded the value here it is working properly.Kindly please rectify my code how i will pass "SubjectofIssuePath"
in File fin=new File();


File fin=new File("SubjectofIssuePath")

File fin=new File("http://127.0.0.1:81/help/Subject of Issue.txt");

Thanks a lot in Advance.

Regards
Sumanta Panda
x.jsp
<%
String SubjectofIssuePath = null;
ResourceBundle bundle = null;

if(Config.serverType != null && "NT".equals(Config.serverType))
{
bundle = PropertyResourceBundle.getBundle("ItsPropertiesNT");

}

if(bundle != null)
{
SubjectofIssuePath = bundle.getString("SubjectofIssue");
out.println("SubjectofIssuePath"+SubjectofIssuePath)//http://127.0.0.1:81/help/Subject of Issue.txt
}
%>
<%
try{
String theBR;
File fin=new File("SubjectofIssuePath");
FileReader fr=new FileReader(fin);
BufferedReader br=new BufferedReader(fr);
theBR=br.readLine();
String[] theSplit=theBR.split(",");
for(int i=0;i<theSplit.length;i++)
out.print("<option value=\"" + theSplit[i] +
"\">" + theSplit[i] + "</option>");
// out.print("</select>");

}catch(Exception Ex){
System.out.println("exception in getting connection"+Ex.getMessage());
}
%>
 
Marshal
Posts: 80140
418
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That looks like something which would sit better on another forum . . . moving.
 
sumanta panda
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear All,
Please guide me how i will pass "SubjectofIssuePath" in File fin=new File();

I am getting stuck to resolve this issue.I am finding null value when i
pass the "SubjectofIssuePath" in File fin=new File();

Please advise me for the needful.

Thanks a lot in advance.

I wish you Happy new Year@2009 in Advance to all of my JavaRanch Team..


Regards
Sumanta Panda
 
If you live in a cold climate and on the grid, incandescent light can use less energy than LED. Tiny ad:
New web page for Paul's Rocket Mass Heaters movies
https://coderanch.com/t/785239/web-page-Paul-Rocket-Mass
reply
    Bookmark Topic Watch Topic
  • New Topic