Linked Questions
909 questions linked to/from How can I avoid Java code in JSP files, using JSP 2?
34
votes
7
answers
39k
views
How to avoid using scriptlets in my JSP page? [duplicate]
I've been told that the use of scriptlets (<%= ... %>) in my JSP pages isn't such a great idea.
Can someone with a bit more java/jsp experience please give me some pointers as to how to change ...
22
votes
3
answers
9k
views
JSP - What is wrong with scriptlets, and what to use instead [duplicate]
I read about JSP in a book many years ago, and recently decided to learn on my own. I now know how to use JSP scriptlets, expressions, and declarations
<%! String str = "Hello World" %...
4
votes
5
answers
7k
views
Tag library versus scriptlets in JSP [duplicate]
What is the advantage (if there is one) of using a custom action instead of a scriptlet?
For example, which is better in a performance context?
<c:if test="${param.Clear}">
<font color="#...
6
votes
4
answers
772
views
How to keep logic out of a JSP? [duplicate]
I need to build a table in a JSP.
I have an arraylist with a bunch of beans, and the beans were made from a resultset, just from the rows returned from a DB call.
Depending on the data, I want to ...
bmw0128's user avatar
- 13.8k
0
votes
1
answer
4k
views
Access an object in JSP [duplicate]
I have this problem.
Is there any problem on directly accessing POJO class or an entity class in JSP, what is the best practice for that ?
0
votes
1
answer
3k
views
JSP access global variables [duplicate]
I'm trying to set 2 variables in 1 JSP:
session.setAttribute("name", aName);
session.setAttribute("amount", amount);
response.sendRedirect("transferSuccess.jsp");
And trying to access this ...
2
votes
2
answers
2k
views
Disadvantages of using scriptlet? [duplicate]
I want to know the whole thing about using scriplet. Why is it not recommended when coding JSP(s). Everytime I ask about coding with scriptlet, they pointing me not to use it and use JSTL instead.
3
votes
1
answer
1k
views
How do I add a servlet to replace scriptlets in a JSP? [duplicate]
I have inherited a large legacy web application that is constructed mainly of JSP files linked together with HTML frames. I've been reading Working Effectively with Legacy code and I've found a good ...
-1
votes
3
answers
1k
views
about using scriplets in JSP [duplicate]
I am new to JSP. I created a web application using JSP.
I written the java code inside the JSP scriptlets(<%.....%>).
For database connection also I fallowed the same manner.
Example:
html ...
0
votes
1
answer
796
views
How do I split Java code away from a jsp page in NetBeans? [duplicate]
I was assigned a task of making a NetBeans jsp page to run on Tomcat so that the code interfaces and queries a MySql table in order to retrieve its data and display them on an IE page. I did that and ...
0
votes
1
answer
657
views
Why to use JSTL? What will be the harm in when we use data base connection in JSP file with connection string to get the data sent from servlet [duplicate]
In Below code JDBC connection is done in JSP file itself. What the harm in that. I am new to this and finding in most of the sites its asked to use JSTL for SQL data, what is the difference between ...
3
votes
1
answer
516
views
How to convert scriptlets into jstl tags [duplicate]
I tried turning these scriptlets into jstl tags with no success, is it not doable with these lines of codes, and if it can how so? thanks
<%
//String file = application.getRealPath("C:/...
0
votes
3
answers
524
views
How to divide this DROPDOWN menu codes to servlet, dao and JSP? [duplicate]
i am tring to avoid java code in jsp file. But i couldnt figure the solution. Can anyone help me?
JSP file :
<select>
<%
try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
String url=...
0
votes
1
answer
256
views
Using Scriptlets in JSP [duplicate]
Is it good to use scriptlets in jsp files? I'm using them in one of my project but it have been so frustrating using them. Especially simple if statements, whenever I add if statement and do ...
0
votes
1
answer
169
views
Java, OpenOffice, Creating Getting document as jsp response as a pdf [duplicate]
I am trying to integrate open office in java. What I am doing is creating a document, and want to get that document in a pdf as a jsp response.. But i am not able to do that. I am able to create an ...