Let me try a slightly different tack....

When I try to access a servlet based almost solely on the session example I
get the following.  I've never dealt with resources in my limited Java
experience.  I don't expect the answer per se but a gentle nudge (or kick in
the butt) in the proper direction would be greatly appreciated.


> Error: 500
> Internal Servlet Error:
>
> java.util.MissingResourceException: Can't find resource
>         at java.util.ResourceBundle.getObject(Compiled Code)
>         at java.util.ResourceBundle.getString(ResourceBundle.java:258)
>         at Authenticate.doGet(Compiled Code)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:715)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:840)
>         at
> com.sun.web.core.ServletWrapper.handleRequest(ServletWrapper.java:154)
>         at
> com.sun.web.core.InvokerServlet.service(InvokerServlet.java:168)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:840)
>         at
> com.sun.web.core.ServletWrapper.handleRequest(ServletWrapper.java:154)
>         at com.sun.web.core.Context.handleRequest(Context.java:412)
>         at com.sun.web.server.ConnectionHandler.run(Compiled Code)
>
> The code that refers to the resource is identical to the examples that
> I've
> looked at.  I'm using the following platform etc.
>
> Windows NT (sp4)
> VAJ TEch Preview Java 2 SDK
> Java Server Web Dev Kit Version 1.0 EA
>
>
> I greatly appreciate any help offered,
> Wade Hovind
> [EMAIL PROTECTED]
>
>
> Source Code Follows:
>
> import java.io.*;
> import java.text.*;
> import java.util.*;
> import javax.servlet.*;
> import javax.servlet.http.*;
>
>
> public class Authenticate extends HttpServlet {
>
>         ResourceBundle rb = ResourceBundle.getBundle("LocalStrings");
>
> /**
>  * Insert the method's description here.
>  * Creation date: (6/27/99 10:39:09 AM)
>  * @param request javax.servlet.http.HttpServletRequest
>  * @param response javax.servlet.http.HttpServletResponse
>  * @exception javax.servlet.ServletException The exception description.
>  * @exception java.io.IOException The exception description.
>  */
> public void doGet(HttpServletRequest request, HttpServletResponse
> response)
> throws javax.servlet.ServletException, java.io.IOException {
>         response.setContentType("text/html");
>         PrintWriter out = response.getWriter();
>         out.println("<html>");
>         out.println("<body bgcolor=\"white\">");
>         out.println("<head>");
>         String title = rb.getString("sessions.title");
>         out.println("<title>" + title + "</title>");
>         out.println("</head>");
>         out.println("<body>");
>         //out.println("<H2>Working!</H2>");
>
>         HttpSession session = request.getSession();
>         out.println(rb.getString("sessions.id") + " " + session.getId());
>         out.println("<br>");
>         out.println(rb.getString("sessions.created") + " ");
>         out.println(new Date(session.getCreationTime()) + "<br>");
>         out.println(rb.getString("sessions.lastaccessed") + " ");
>         out.println(new Date(session.getLastAccessedTime()));
>         String username = request.getParameter("username");
>         String password = request.getParameter("password");
>         if (username != null && password != null) {
>                 session.putValue(username, password);
>         }
>         int usernameIndex = -1;
>         int passwordIndex = -1;
>         String[] valueNames = session.getValueNames();
>         if (valueNames != null && valueNames.length > 0) {
>                 for (int i = 0; i < valueNames.length; i++) {
>                         String name = valueNames[i];
>                         String value = session.getValue(name).toString();
>                         if (name == "username") {
>                                 usernameIndex = i;
>                         }
>                         if (name == "password" && usernameIndex != -1) {
>                                 passwordIndex = i;
>                         }
>                 }
>                 if (usernameIndex != -1 && passwordIndex != -1) {
>
> out.println(session.getValue(valueNames[usernameIndex]).toString() + " is
> authenticated <BR>");
>
> out.println(session.getValue(valueNames[passwordIndex]).toString() + " was
> the password <BR>");
>                 } else {
>                         out.println("Not authenticated");
>                 }
>         }
>         out.println("<P>");
>         out.print("<form action=\"");
>         out.print("SessionExample\" ");
>         out.println("method=POST>");
>         out.println(rb.getString("Username"));
>         out.println("<input type=text size=20 name=username>");
>         out.println("<br>");
>         out.println(rb.getString("Password"));
>         out.println("<input type=password size=20 name=password>");
>         out.println("<br>");
>         out.println("<input type=submit>");
>         out.println("</form>");
>         out.println("</body>");
>         out.println("</html>");
> }
> /**
>  * Insert the method's description here.
>  * Creation date: (6/27/99 10:41:35 AM)
>  * @param request javax.servlet.http.HttpServletRequest
>  * @param response javax.servlet.http.HttpServletResponse
>  * @exception javax.servlet.ServletException The exception description.
>  * @exception java.io.IOException The exception description.
>  */
> public void doPost(HttpServletRequest request, HttpServletResponse
> response)
>
>         throws javax.servlet.ServletException, java.io.IOException
> {
>         doGet(request, response);
> }
> }
>
> ==========================================================================
> =
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> body
> of the message "signoff JSP-INTEREST".  For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JSP-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to