prathamesh bandivadekar

Ranch Hand
+ Follow
since May 22, 2008
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by prathamesh bandivadekar

Thank God, the new version of SIA is back. Thank you Craig.
1 year ago
Hi All,

I was trying to use Error Page Concept in my Error.jsp by using <%page isErrorPage="true"%>.

But when i use this tag in it, "Internal Server Error Appears". There is no information on the error.

Http 500 Error status.

But when i remove <%page isErrorPage="true"%>, the page works fine.

Why is so?
10 years ago
JSP
yes. they are in the same folder. outside WEB-INF.
10 years ago
JSP
When i m trying to login, i have given a dummy logic hardcoding the uname and password.

if the uname and password do not match , the processing logic throws Exception.

Just to demonstrate the errorPAge attribute of the Page Directive i m using this exception.

If i use try-catch block in the processing, it works. But do no transfer the command to ErrorPage(which is intended).

If i remove that try-catch...It gives Http 500 error.

Login.jsp >>> LoginProcess.jsp(Process Logic)>>>> If Successful >>>> Welcome.jsp
If Failed >>>> Error.jsp
10 years ago
JSP
I am writing following code:

<%@page errorPage="Error.jsp"%>

<%

String user = (String)request.getParameter("uname");

String password = (String) request.getParameter("password");

try{
if(user.equals("Prathamesh") && password.equals("India")){

out.println("Welcome");

out.flush();

RequestDispatcher rd = request.getRequestDispatcher("/Welcome.jsp");

rd.include(request, response);


}else{
throw new Exception();
}

}catch(Exception e){
throw new Exception("Servlet Error");
}

%>

Whenever i enter wrong password it should go to Error.jsp which is as follows:

<%@page isErrorPage="true" %>

Error Welcome !

<%= exception.getMessage() %>


But it gives Http 500

The website cannot display the page
HTTP 500
Most likely causes:
The website is under maintenance.
The website has a programming error.

Help will be much appriciated.

Regards,
Prathamesh.
10 years ago
JSP
But our tutor showed the same example in .html file!

Unfortunately he is not available for any comments!

So i was wondering how can we incorporate such jsp tags in .html file!
10 years ago
JSP
I am trying to add a tag JSP for hands-on. But it is not working.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>First JSP</TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>

<BODY>
<FORM Action="LoginProcess.jsp">

Username : <input type="text" name="uname" value="<%= request.getParameter("uname")%>"/>

Password : <input type="password" name="password"/>


<INPUT type="submit" value="Login"/>

</FORM>
</BODY>
</HTML>

I am saving this file as Login.html
If login fails it returns to the same page as a error page. It is supposed to show entered username in the Username box.

But is is showing as

Username : <%= request.getParameter("uname")%>
Password :

Now if i change the file name to Login.jsp it works fine!

Why is that so?

Please do reply!

Output is coming as not expected in .html file

10 years ago
JSP
can you post your pojo class?
Hi all,

I am trying to implement cascade="delete" in my small application having many-to-one relation.

Cascade is working with cascade="save-update" when i am trying to save the one of the object in many-to-one relation.

even cascade="all" is not working for delete option.

Thanks in Adavance!
org.hibernate.InvalidMappingException: Could not parse mapping document from res
ource Employee.hbm.xml

Employee.hbm.xml

<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-mapping>
<class name="com.modeln.hibernate.Employee" table="emp">

<id name="empno" column="empno">
<generator class="assigned"/>
</id>

<property name="name">
<column name="ename"/>
</property>

<property name="salary">
<column name="sal"/>
</property>

<property name="deptno">
<column name="deptno"/>
</property>

</class>
</hibernate-mapping>



hibernate.cfg.xml


<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-configuration>
<session-factory>

<property name="hibernate.connection.driver_class">
com.mysql.jdbc.Driver
</property>

<property name="hibernate.connection.url">
jdbc:mysql://localhost:3306/my_db
</property>

<property name="hibernate.connection.username">root</property>

<property name="hibernate.connection.password">root</property>

<property name="dialect">org.hibernate.dialect.MySQLDialect</property>

<property name="show_sql">true</property>


<!--Mapping Resource Description -->
<mapping resource="Employee.hbm.xml"/>


</session-factory>
</hibernate-configuration>


Can anyone suggest the problem with above two XML files?
Hi Team,

I want to have some hands-on on Hibernate.

Can you please suggest me,what all is need to get started with Hibernate?


It will be a great help!
i have tried the same thing with hibernate!

Here i will take an example of Employee object.

An Employee can be associated with multiple departments.

So now our Employee can have a collection of Dept objects.

So now i can map this Dept Collection in Hibernate using <one-to-many> tag specified in Employees.hbm.xml

Where, for Dept i will have seperate Dept.hbm.xml describing Dept object properties.

If you want i can share the code with you!
The problem is resolved.

I have uninstalled MS SQL server from my machine!

I dont want that programe running on my machine!

Making things complicated and dependant is the legacy of MS!

Using MySQL now!
I dont have any idea about that!

Can you please tell me how to check whether my MS SQL server is configured for that or not?

I think it is easy to work with Oracle rather than working with MS,they alwayz make things complicated!

Oralce do not have such config for TCP/IP!