Is there any way of passing data to JAVA class from a JSP page without using Servlets? I have a form which i send to JAVA class without using servlet. Also I don’t want to use Struts1 for this purpose.
Please guide me.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Different ways of calling java code from JSP pages
Call Java code directly
Place all Java code in JSP page, scriptlets. Appropriate only for very small amounts of code.
Call Java code indirectly
Develop separate utility classes. Insert into JSP page just the Java code needed to invoke the utility classes.
Use beans (Standard actions)
Develop separate utility classes structured as beans. Use jsp:useBean, jsp:getProperty, and jsp:setProperty to invoke the code.
Use the MVC architecture
I see that you don’t want to use servlets.
Use the JSP EL
Use shorthand syntax to access and output object properties. Usually used in conjunction with beans and MVC.
Use custom tags
Develop tag handler classes or use a tag library(JSTL).