Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Techniques to hide password

 
Raj Puri
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have pretty much done my JSP page but I see I hard coded userid/password right there. What are the alternatives I have with minimum changes? I was looking at some bean that can return me a connection object and I can save that bean under WEB-INF directory? Is there a bean like that with JSP 2.0 that can be used w/o much code or I need to pretty much right my own servlet or Bean. Any other ideas or should I just forget all my code and move all code to develop a servlet that returns a HTML page to browser. My JSP basically returns a HTML form with standard Submit/Reset buttons with pre-populated list boxes etc. In my servlet class I learnt that a servlet can be used to throw an HTML form in browser.
 
Mahesh Pinnamaneni
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
u can use Java Bean for conection purpose.write ur code for connection to Db in a Bean .here is a sample code.
<jsp:useBean id="conn" scope="request" class="conn.Conn" />
Connection con =conn.getCon();
now using this connection object u can go for statement or PrepStmt or whatever u like.
bye
Mahesh
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i suggest you to go for some clearer design. gettin connection in jsp/servlet is not recommended.
 
Raj Puri
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you elaborate more on what you mean clearer design? I saw some example
like connection pooling java forum is that what you meant?
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
your mess of doing database access and everything else in JSPs.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic