• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Error in jsp page

 
Ranch Hand
Posts: 151
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi;
I am developing jsp application for student feedback system. I am using MYSQL as backend. My theme is like:
1.each student will have username and password set by administrator.
2.once user log in particular system it will show various poll topic and accordingly he/she can poll or submit own view.
for that i had created user table in MYSQL DATABE having field emailid as username and password for password. In my validateuserid show the following error(kindly see the comment in rd color)


<%@ page language ="java" %>
<%@ page import="java.sql.*, javax.sql.*, javax.naming.*,java.io.*,java.util.*" %>
<jsp:useBean id="checker" class="com.indiabiznet.igidr.general.PermissionChecker" />
<%
String userid=request.getParameter("userid");
String password=request.getParameter("pass");

InitialContext context = new InitialContext();
DataSource ds = (DataSource) context.lookup("java:comp/env/jdbc/mynewdatabase");
Connection conn = ds.getConnection();
context.close();
session.setAttribute("MyConnection",conn);

Logger logger = new Logger(conn);//can not find symbol,class:logger
session.setAttribute("logger",logger);
Statement stmt=conn.createStatement();
ResultSet rs=stmt.executeQuery("select UserId from user where emailid='"+userid+"' and password='"+password+"'");
rs.next();
String UserID = rs.getString("UserId");
rs.close();
if (UserID==null )
{
out.println("Invalid User");
session.invalidate();
%>//setaatribute(java.lang.string,java.lang .object)in javax.servlet.http. httpsession can not appied to (java.lang.string,Logger)

<jsp:forward page="/AccessDenied.jsp" />

<%
}
else
{
out.println("Valid User");
}
session.setAttribute("UserID",UserID);


%>
<jsp:forward page="/main.jsp" />

kindly give guidelines for above.
waiting for your valuable suggestion.
thanks and regards
harshal
 
Harshal Gurav
Ranch Hand
Posts: 151
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
kindly help me
regards
harshal
 
Ranch Hand
Posts: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Logger logger = new Logger(conn);//can not find symbol,class:logger

Import class Logger.

second error ll automatically removed , when you correct first one..
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic