All Questions

1458
votes
28answers
235174 views

How to avoid Java code in JSP files?

I'm new to Java EE and I know that something like the following three lines <%= x+1 %> <%= request.getParameter("name") %> <%! counter++; %> is an old school way of coding and in ...
575
votes
12answers
427870 views

How to upload files to server using JSP/Servlet?

How can I upload files to server using JSP/Servlet? I tried this: <form action="upload" method="post"> <input type="text" name="description" /> <input type="file" name="file" /...
44
votes
1answers
50771 views

Servlet returns "HTTP Status 404 The requested resource (/servlet) is not available"

I have an HTML form in a JSP file in my WebContent/jsps folder. I have a servlet class servlet.java in my default package in src folder. In my web.xml it is mapped as /servlet. I have tried several U...
273
votes
7answers
249728 views

How to use Servlets and Ajax?

I'm very new to web apps and Servlets and I have the following question: Whenever I print something inside the servlet and call it by the webbrowser, it returns a new page containing that text. Is th...
299
votes
15answers
486212 views

Download a file by jQuery.Ajax

I have a Struts2 action in the server side for file downloading. <action name="download" class="com.xxx.DownAction"> <result name="success" type="stream"> <param name="cont...
38
votes
5answers
47712 views

Show JDBC ResultSet in HTML in JSP page using MVC and DAO pattern

I'm implementing MVC using JSP and JDBC. I have imported a database class file to my JSP file and I would like to show the data of a DB table. I don't know how I should return the ResultSet from the J...
22
votes
4answers
66053 views

How to retrieve and display images from a database in a JSP page?

How can I retrieve and display images from a database in a JSP page?
333
votes
5answers
92943 views

Design Patterns web based applications

I am designing a simple web-based application. I am new to this web-based domain.I needed your advice regarding the design patterns like how responsibility should be distributed among Servlets, criter...
67
votes
7answers
92090 views

Browser can't access/find relative resources like CSS, images and links when calling a Servlet which forwards to a JSP

I'm having trouble with loading CSS and images and creating links to other pages when I have a servlet forward to a JSP. Specifically, when I set my <welcome-file> to index.jsp, the CSS is being...
693
votes
15answers
345929 views

What is the difference between JSF, Servlet and JSP?

How are JSP and Servlet related to each other? Is JSP some kind of Servlet? How are JSP and JSF related to each other? Is JSF some kind of prebuild UI based JSP like ASP.NET-MVC?

Previous Next