Results 1 to 4 of 4
Thread: 500 error
- 02-15-2012, 12:10 PM #1
Member
- Join Date
- Oct 2011
- Posts
- 2
- Rep Power
- 0
500 error
I got error while i run my HTML file:
Entity File
package com;
public class LeavePolicyEntity {
private String leaveid;
private String typeofleave;
private int initialleave;
public String getLeaveid() {
return leaveid;
}
public void setLeaveid(String leaveid) {
this.leaveid = leaveid;
}
public String getTypeofleave() {
return typeofleave;
}
public void setTypeofleave(String typeofleave) {
this.typeofleave = typeofleave;
}
public int getInitialleave() {
return initialleave;
}
public void setInitialleave(int initialleave) {
this.initialleave = initialleave;
}}
Test File
package com;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
public class TestPolicy {
public boolean addleavepolicy (LeavePolicyEntity leavepolicy) {
// TODO Auto-generated method stub
SessionFactory factory = new Configuration().configure().buildSessionFactory();
Session session=factory.openSession();
session.beginTransaction();
session.save(leavepolicy);
session.getTransaction().commit();
return true;
}}
HBM file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="com">
<class name="LeavePolicyEntity" table="leavepolicy">
<id name="leaveid" column="leave_id">
</id>
<property name="typeofleave" column="type_of_leave"/>
<property name="initialleave" column="initial_leave"/>
</class>
</hibernate-mapping>
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body bgcolor=orange>
<form action="Test.jsp">
<table align="right">
<tr>
<td> <a href="url">SIGNOUT</a> </td>
</tr>
</table> <table cellspacing="15">
<tr>
<td> <font size="2"> TYPE OF LEAVE </font> </td>
<td> <input type="text" name="typeofleave" size="12"> </td>
</tr>
<tr>
<td> <font size="2"> DAYS ALLOCATED </font> </td>
<td> <input type="text" name="daysallocated" size="12"> </td>
</tr><tr>
<td> <input type="submit" value="GO" size="12"> </td>
<td> <input type="submit" value="ADD" size="12"> </td>
<td> <input type="submit" value="MODIFY" size="12"> </td>
<td> <input type="submit" value="DELETE" size="12"> </td>
<td> <input type="reset" value="CLEAR" size="12"> </td> </tr>
</table>
</form>
</body>
</html>
JSP
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<jsp:useBean id="testpolicy" class="com.TestPolicy"> </jsp:useBean>
<jsp:setProperty property="*" name="testpolicy"/>
<jsp:useBean id="leavepolicy" class="com.LeavePolicyEntity"></jsp:useBean>
<jsp:setProperty property="*" name="leavepolicy"/>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<%
out.println("<html>");
out.println("<body>");
out.println("<form>");
leavepolicy.setTypeofleave(request.getParameter("t ypeofleave"));
leavepolicy.setInitialleave(Integer.parseInt("days allocated"));
boolean status=testpolicy.addleavepolicy(leavepolicy);
if(status==true){
out.println("<br>");
out.println("<h1>Student detail Added successfully</h1>");
out.println("<br>");
out.println("<br>");
}
else{
out.println("<h1>System Error,Sorry try again Later</h1>");
}
out.println("</form>");
out.println("</body>");
out.println("</html>");
out.println("</form>");
out.println("</body>");
out.println("</html>");
%>
</body>
</html>
Please solve my problem. also i put mapping in cfg file and import jar file in lib.
- 02-15-2012, 12:26 PM #2
Moderator
- Join Date
- Apr 2009
- Posts
- 10,484
- Rep Power
- 16
Re: 500 error
And?
Where is the 500?
Where/when does it occur?
WHat do your server logs say?
Don't make us guess...you have the details, we don't.
- 02-15-2012, 12:56 PM #3
Re: 500 error
I wouldn't hold your breath. This one seems to post for posting's sake -- not for advice, as witness the lack of code tags in spite of your response on yesterday's thread, to which he/she/it didn't bother to reply: 404 error
dbWhy do they call it rush hour when nothing moves? - Robin Williams
- 02-15-2012, 02:11 PM #4
Moderator
- Join Date
- Apr 2009
- Posts
- 10,484
- Rep Power
- 16
Similar Threads
-
java out of memory error-heap space error
By elsanthosh in forum NetBeansReplies: 4Last Post: 06-15-2010, 09:31 AM -
> Operator cannot be applied error and return incompatible types error
By corney_16 in forum New To JavaReplies: 1Last Post: 03-10-2010, 01:53 PM -
Thread: Error 500--Internal Server Error java.lang.NullPointerException
By jackdear44 in forum New To JavaReplies: 1Last Post: 12-05-2009, 07:28 AM -
java.lang.Error: Error opening DSound for capture
By NARs in forum NetworkingReplies: 1Last Post: 10-26-2009, 04:38 PM -
Diference Between compiler error Garbage collection and Runtime Error?
By makpandian in forum New To JavaReplies: 3Last Post: 01-23-2009, 08:53 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks