Ashwini Kashyap

Ranch Hand
+ Follow
since Aug 30, 2012
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
2
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 Ashwini Kashyap

HttpServlet will create a servlet supporting http protocol while GenericServlet as the name suggests it's generic and is protocol independent.

Thanks,
Ashwini Kashyap | www.infocepts.com
7 years ago
There is no harm in doing so.
PreparedStatement can be used for SQL with no parameters (we use Statement) but mostly they are used for SQL statements that take parameters.

For further reference you may see url.

Thanks,
Ashwini Kashyap | www.infocepts.com
Ok.. But keep your xml without those mappings.
Also, why have you used @Configuration in controller class?

7 years ago

<bean id="contactService" class="com.springhibernate.contact.service.ContactServiceImpl" />
<bean id="contactDAO" class="com.springhibernate.contact.dao.ContactDAOImpl" />



Problem is here, when you have made use of annotations, why are using above mappings in xml?

Please go through that explanations in that tutorial step by step and you will surely be able to wire service class into your controller which currently your code is deprived of.

Thanks,
Ashwini Kashyap | www.infocepts.com
7 years ago

java.lang.NullPointerException
at com.trimax.onlinepass.actions.RegistrationAction.add(RegistrationAction.java:91)



At line 91, you are trying to access a null object, which is why you getting NPE.
Check for null, before you access objects.

Thanks,
Ashwini Kashyap | www.infocepts.com
7 years ago
Most welcome Sarita :-)
7 years ago

When I run that project in netbeans as I am used to netbeans it gives deployment error and does not run



For importing eclipse project in netbeans, refer here

Thanks,
Ashwini Kashyap | www.infocepts.com
7 years ago
To get started, I think you should first go through as to what is MVC architecture and then you can proceed further.

To integrate spring with hibernate, you may refer here.

Thanks,
Ashwini Kashyap | www.infocepts.com
7 years ago

toString() tries to read data from the String s


to convert to string and before that actually happens due to null object it throws NPE.

Thanks,
Ashwini
7 years ago
Refer here for getting started struts 2.

Thanks,
Ashwini Kashyap | www.infocepts.com
7 years ago
If you try to access any null object, you land up with NullPointerException.
Always check for null objects before trying to access them.

Thanks,
Ashwini Kashyap | www.infocepts.com
7 years ago

Type mismatch: cannot convert from String to int



JOptionPane.showInputDialog() method returns string and you are collecting it in int object hence the exception.

Thanks,
Ashwini Kashyap | www.infocepts.com
7 years ago

i am returning success from execute method so why i have to do the mapping of download



Success will get executed only when your "download" action class will get called and you haven't mapped that action and hence it wont go into your class and execute further.

Your code should be like -

<action name="download" class=".....">
<result name="success" type="stream">
.......

instead of
<action name="success" class=".....">
<result name="success" type="stream">
.......


Regards,
Ashwini
7 years ago
You have missed mapping "download" action in struts.xml file.
Hence it isn't able to download it. Hope this helps.

Thanks,
Ashwini Kashyap | www.infocepts.com
7 years ago