Jump to content

Recommended Posts

Posted

[quote name='Thingarodu' timestamp='1352435144' post='1302767655']
oka sari idi try cheyyi... I think this should work for you


ResourceBundle rb = ResourceBundle.getBundle( "com.test.sample");

[color=#ff0000]Properties file should be in the "com.test" package with name as "sample.properties".[/color]

then you can get the values from properties using rb.getString( "name" )
[/quote]java.util.MissingResourceException: Can't find bundle for base name com.tekreliance.servletexample.user.properties, locale en_US
java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1427)
java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1250)
java.util.ResourceBundle.getBundle(ResourceBundle.java:705)
com.tekreliance.servletexample.Service.getConnection(Service.java:16)
com.tekreliance.servletexample.MyServlet.doPost(MyServlet.java:50)
javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

  • Replies 37
  • Created
  • Last Reply

Top Posters In This Topic

  • chinni005

    19

  • Thingarodu

    8

  • chandu1987

    3

  • pavan_613

    2

Popular Days

Top Posters In This Topic

Posted

bhayya.. oka 2 JSP's unnayi Home n Succes and veeti kosam oka web.xml undhi and nenu oka Myservlet class rakunna..!

and oka properties file lo db url username and password pettukunna.!

ee oka service class theskuni dbconnections kosam oka connection object ni return chese method ni raaskunna e class lo..! so with the same class i'm trying to load the properties file to register the driver and established a connection.. So, e service class separate class complete ga.. hard code chykunda evarayina db ki connect avvalankunte ee class ni instantiate chesi connect ayyettu..!

now i'm facing problem in loading this properties file

an also the main aim of the task is

Home.jsp lo username n password fields untaayi db lo konni records unayi.. e user given username db records tho match ayithe..! na Servlet class lo RequestDispatcher use chei home page ni Succes page ki forward chesthunna

idhi matter

Posted

[quote name='Hava5' timestamp='1352435980' post='1302767691']
java.util.MissingResourceException: Can't find bundle for base name com.tekreliance.servletexample.user.[color=#ff0000]properties[/color], locale en_US
java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1427)
java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1250)
java.util.ResourceBundle.getBundle(ResourceBundle.java:705)
com.tekreliance.servletexample.Service.getConnection(Service.java:16)
com.tekreliance.servletexample.MyServlet.doPost(MyServlet.java:50)
javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
[/quote]

ResourceBundle lo ".properties" ani mention cheyyakudadu.... just mention it as "com.tekreliance.servletexample.user"

Posted

try this ...... make sure your property file is in classpath ............

InputStream inputStream = Thread.currentThread().getContextClassLoader().getResource(propertyFileName).openStream();
Properties theProps = new Properties();
theProps.load(inputStream);

Posted

[quote name='Hava5' timestamp='1352436387' post='1302767707']
bhayya.. oka 2 JSP's unnayi Home n Succes and veeti kosam oka web.xml undhi and nenu oka Myservlet class rakunna..!

and oka properties file lo db url username and password pettukunna.!

ee oka service class theskuni dbconnections kosam oka connection object ni return chese method ni raaskunna e class lo..! so with the same class i'm trying to load the properties file to register the driver and established a connection.. So, e service class separate class complete ga.. hard code chykunda evarayina db ki connect avvalankunte ee class ni instantiate chesi connect ayyettu..!

now i'm facing problem in loading this properties file

an also the main aim of the task is

Home.jsp lo username n password fields untaayi db lo konni records unayi.. e user given username db records tho match ayithe..! na Servlet class lo RequestDispatcher use chei home page ni Succes page ki forward chesthunna

idhi matter
[/quote]


task easy gane undhi...but nenu antha experienced kaadhule....neeku simple steps lo cheppatanki....but naaku time isthe....google chesi complete cheyyagalanemoo...then I can explain it to you

Posted

[quote name='chandu1987' timestamp='1352436769' post='1302767727']
task easy gane undhi...but nenu antha experienced kaadhule....neeku simple steps lo cheppatanki....but naaku time isthe....google chesi complete cheyyagalanemoo...then I can explain it to you
[/quote]
yup easy task

Posted

this.getClass().getResouceAsStream("/load.properties);

ba idhi use chey work out avachu

×
×
  • Create New...