Click here to Skip to main content
15,889,527 members
Everything / JSP

JSP

JSP

Great Reads

by Mircea Diaconescu, Gerd Wagner
Learn how to build a Java back-end web application with minimal effort, using Java Server Faces (JSF) as the user interface technology, the Java Persistence API (JPA) for object-to-storage mapping, and a MySQL database.
by V.
How to dynamically build a JQPlot graph through the code behind.
by Dynamsoft
In this article, I’ll show you how to capture images from your web browser, edit them, and then upload them to your system.
by Han Bo Sun
In this tutorial, I am going to show the readers how to create an MVC application using Spring Boot, packaging as a self host WAR file, and execute using embedded Jetty application server.

Latest Articles

by ToughDev
Create custom nanorc file for JSP in nano to enhance syntax highlighting and readability, along with basic autocomplete
by Han Bo Sun
This tutorial discusses the way to setup a Spring boot application that can utilize JSTL template and taglib.
by Han Bo Sun
In this tutorial, I am going to show the readers how to create an MVC application using Spring Boot, packaging as a self host WAR file, and execute using embedded Jetty application server.
by Han Bo Sun
In this article, I will show the reader how to secure a web application based on Spring Boot and WAR archive, using the Spring Security and Tags. The application will have a login page, page access based on user roles, login failure, and access denied pages.

All Articles

Sort by Updated

JSP 

31 Oct 2023 by ToughDev
Create custom nanorc file for JSP in nano to enhance syntax highlighting and readability, along with basic autocomplete
19 Sep 2023 by Member 4246451
I have recently been working with the APG's cash drawer setup. I need with our existing cloud ERP (servlet-based) which uses JSP files to feed the pages in the web browser. I have recently bought a cash drawer 554A USB Pro cash drawers for APG...
21 Oct 2022 by Joydeep Banerjee 2022
Create a database for a Student Result system consisting of the following two tables: Student (SID, name, ContactAddress) Results (SubjectID, SID, Marks) Develop and deploy a web based “Result Display System” using JSP, any database backend and...
21 Oct 2022 by Richard MacCutchan
Sorry, this site does not provide code to order. If you are unable even to start your assignment then you should review your course notes and/or talk to your teacher.
24 Sep 2022 by Member 15226818
I've tried to update my MySQL table through the JSP servlet but it's not updating on the table. Also, there are no errors showing !! What I have tried: package fuel.web; import java.io.IOException; import java.sql.Date; import...
21 Sep 2022 by OriginalGriff
Start by using the debugger to find out exactly what is in the three parameters you apply to the UNPDATE query: dt, tot, and fname. At a guess, fname is the wrong value, since the query references the FuelType column and unless fname matches...
14 Aug 2022 by N Mohamed rafi
/* Style the body */ body { font-family: Comic Sans MS; margin: 0; } .header { padding: 5px; text-align: center; background:...
14 Aug 2022 by OriginalGriff
Don't do it like that. Never concatenate strings to build a SQL command. It leaves you wide open to accidental or deliberate SQL Injection attack which can destroy your entire database. Always use Parameterized queries instead. When you...
27 Mar 2022 by Muhammd Aamir
I have been implementing a popup on button click, however when I want to filter the data, Like in highlighted snap & press ENTER the popup disappear. The issues is on every popup. I am using 12.2.1.4.0 version of Jdeveloper. Please help to get...
8 Feb 2022 by Richard Deeming
commandButton (JSF 2.2 View Declaration Language: Facelets Variant)[^] Literally the first result of a search for "JSF commandbutton". In future, please try to do your own research.
20 Jan 2022 by Keshav 2022
The build is successful but I am unable to run the servlet as whenever I try to run I get 500-Internal Server error. Error snapshot attached for reference. It's giving some runtime exception. NetBeans IDE - 12.2 Apache Server -...
20 Jan 2022 by thatraja
After quick search, found out that nb-javac plugin[^] solves the issue. Below threads confirms the same servlets - @WebServlet fails in Netbeans 11.0 with java.lang.RuntimeException: com.example.NewServlet.(NewServlet.java:1) - Stack...
2 Jan 2022 by hareshdgr8
how can I use crystal report with my JSP web-based application so it is easy for me to develop my invoice and quotation design and I also convert to pdf easily as in windows application ... Please please help me about JSP Web-based Application ...
21 Dec 2021 by Abhijith moody
Am trying to connect jsp to mysql and it is not working , if i connect from php to mysql its working good , is am connecting from jsp then am getting error SQLException caught: Communications link failure Last packet sent to the server was 0 ms...
21 Dec 2021 by Abhijith moody
%@page import="java.sql.*" import="javax.sql.*"%> Connection...
19 Dec 2021 by Iris Luna
Hi All. I'm developing a website using Java 1.5 and Struts but I'm encountering an exception error. I have this view details page and whenever I click back to go back to previous screen/page which is the list page, I encounter Error 500:...
22 Oct 2021 by HIMANSHU SRIVASTAVA Oct2021
**This is loginpage.jsp file in which i am assigning servlet and method.** ...
18 Oct 2021 by Bradley Wellington
Hello everyone I'm new here and didn't find another place to post this question. So recently I graduated from University as a Software Engineer in Sweden. I’ve been taking some time off to recover during the summer and to think through what to...
18 Oct 2021 by RickZeeland
Kotlin seems like a good alternative to Java, see: alternatives-to-java-for-android-development[^] I'm not an Android developer myself, so I can not tell more about the subject. For job security it might be better to look what languages and...
7 Aug 2021 by Patrice T
Quote: I've checked multiple times but I couldn't find any syntax error You are not told there is a syntax error, you are told there is a logical error ! Quote: Parameter index out of range (6 > number of parameters, which is 5). This means...
7 Aug 2021 by OriginalGriff
The problem - the major problem, they generally have many - with youtube "tutorial videos" is that they are there for monetization: they want your views, your subscriptions. They don't care about the quality, or how you get on. The money is all....
3 May 2021 by Suchita@101
I have a table below and Need to store location of data eg ABC location A1, EFD location A2,UVW at C1 dynamically in database. 1 2 3 4 A ABC EFD GHI JKH B PQR EFR QAE IOJ ...
5 Apr 2021 by laken1234
Hey guys! I am learning Java Servlets and trying to exercise with a project of my own. I am using two MySQL tables Users & Users Phones. As you can see from the attached files, each user can have multiple phone numbers. However I fail to make a...
22 Jan 2021 by Member 13740197
I have a JSP code like below having var x and I have added a scriptlet inside function and want access x in scriptlet. But getting errors while accessing, please let me know how to access x inside scriptlet? What I have tried: function...
22 Jan 2021 by Richard Deeming
Your Javascript function runs on the client, long after your JSP code has finished executing. You cannot access client-side variables from server-side code in this way. You will need to find another solution to the problem you're actually trying...
9 Nov 2020 by Member 12035413
I'm using JSP and CKEditor to get website's content DEMO CKEDITOR
15 Jul 2020 by Madhukar Pallam
i am developing a website. i want to set header imge width to 100% of screen.when i am setting working, but user clicks restore_down button the header image is shrinking, but i need to set the image width as sreen width. Because all the clients don't have...
15 Jul 2020 by Member 14890492
use the following code below for html project banner image.
28 May 2020 by Member 14846960
i want to upload and display blob img and text data from data base in jsp using in netbens 8 but showing some error in code .the code is below
28 May 2020 by Member 11432405
I want to display multiple blob images from database on basis of email id but i can only get one image and other image are associated with same email id is not displaying not displaying i need your help to display multiple images from database . What I have tried: package...
24 May 2020 by Member 14842466
try img url format - \project_name\imagefolder_name\imagefilename.jpg
24 May 2020 by naveen712
Images are not displaying in html form when deployed in apache tomcat server. whatto do?
19 May 2020 by Steve363
I just called aBlob.getBinaryStream() with no parameters and it works for me. The function with pos and length parameters throws an exception java.lang.AbstractMethodError: oracle.sql.BLOB.getBinaryStream(JJ)Ljava/io/InputStream; which I was...
19 May 2020 by Member 12779768
I manage to save my BufferedImage into mysql db as BLOP with the help of ByteArrayOutputStream. But now i want to retrieve and convert back to the original BufferedImage, how do i do that? Below is what i tried but the result (BufferedImage) is wrong.What I have tried:Uploading to...
13 May 2020 by CHill60
Instead of commenting that you "are blocked" state actually happens I.e. What is the error message? Based on the comment in your code I think this is the solution to your problem.. In whatever language you use, you have to make sure that the...
13 May 2020 by hwmf
I have an excel sheet with multiple columns. i want this to be imported into sql via 12 tables. but three of this table have foreign keys from other tables how would i do this using java. Please help. Thanks What I have tried: package...
27 Apr 2020 by phil.o
I don't think you can pass parameters values directly in the prepareCall call. The documentation would suggest to do it this way instead: CallableStatement statement = con.prepareCall("{call SP_CustomerDetails(?, ?, ?)}"); statement.setString(2,...
27 Apr 2020 by hareshdgr8
below what i tried please help me Error in RESULT: Callable statements not supported. I am using JSP front end and for Backend using MYSQL 5.6 Please Help me What I have tried: `
25 Apr 2020 by OriginalGriff
To add to what Richard has said, a null reference error one of the most common problems we get asked about, and it's also the one we are least equipped to answer, but you are most equipped to answer yourself. Let me just explain what the error...
25 Apr 2020 by BinthLafeer
HTTP Status 500 - Internal Server Error type Exception report messageInternal Server Error descriptionThe server encountered an internal error that prevented it from fulfilling this request. exception org.apache.jasper.JasperException:...
25 Apr 2020 by Richard MacCutchan
java.lang.NullPointerException Somewhere in your server code you are trying to use a reference that has not been initialised. You will need to use your debugger to find it.
23 Apr 2020 by MadMyche
The problem you are having is that you are using Reserved words in the table definition, so when they are being called in a statement they will need to be escaped. Most IDEs for a language will highlight reserved/special/key- words and my...
23 Apr 2020 by BinthLafeer
com.mysql.jdbc.exceptions.jdbc...
23 Apr 2020 by User 11060979
group is a reserved name so it needs to be quoted when using it as column name. Better is to choose another name for the column. See here for more: Reserved Words - MariaDB Knowledge Base[^] Note: time is basically also reserved but will be...
16 Apr 2020 by W Balboos, GHB
The most sensible way to do this is AJAX. I don't bother with jquery - using straight javaScript, php, etc. Here's your AJAX reference (from where I learned it). AJAX Introduction[^] This makes it pretty straight forward and has examples. ...
16 Apr 2020 by Knowledge_Seeker 2
I have a dropdown box in my html body along with two textboxes. The values in Dropdown box is fetched using sql query. I want to autopopulate the textboxes which are 2 in number with related values of the database table whose value I am getting...
6 Apr 2020 by Member 3321282
_ID = Integer.parseInt(request.getParameter("id")); the request.getParameter("id") is not getting a value. this is because the page, i.e. http://server/BOQ-Form.jsp?id= The numberformatexception null is traced to the Integer.parseInt() not...
6 Apr 2020 by Member 14639038
sir I have created jsp page for boq form to update the boq records. i have written the business logic in the jsp page to select the records based on the id first. when i run the this page. then the page showing the ...
25 Feb 2020 by r.hariprasad.cse
haiiiiii, Give me some idea about how to do chatting program using jsp(java).I am familiar with java web applications.Pleaes help me sir.I have one web application developed myself where user can login and visit their homepage.But now i want to give chatting facility to my user with...
19 Feb 2020 by Richard MacCutchan
You already posted this question at Saving jsp output as pdf[^]. Please do not repost.
1 Feb 2020 by Member 14639038
rfms_excel.java-> package com.rfmsProject.upload; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.PrintWriter; import java.sql.SQLException; import java.util.Iterator; import javax.servlet.RequestDispatcher; import...
1 Feb 2020 by phil.o
ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FTS, Hospitalityexpense, Krishi_KalyanExpenses, manpowerExpensesContract, Manpow' at line 1 You made a mistake while building your SQL query. And despite...
3 Jan 2020 by Christian Graus
The front end CANNOT save data to the back end. It can simply send the data to the back end, where back end code can save it. You can't attach data in a GET, unless it goes on the URL. You need a POST or PUT to have a body.
26 Dec 2019 by Member 14639038
Hi sir, I have written the following application for calling servlet from javascript. but servlet is not able to get request from javascript package com.nt.servlet; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import...
26 Nov 2019 by Member 14639038
reaadExcelServlet.java package com.mvc.upload; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.util.ArrayList; import...
24 Oct 2019 by Member 12974741
Experts, I have a JSP form page which has Text Area field.I have a string contains 300 lines. when I paste the content in text area field, it accepting the content.but when i submit the form, page got stuck there only and not moving to servlet. If I give less than 50/60 lines....
22 Oct 2019 by Han Bo Sun
This tutorial discusses the way to setup a Spring boot application that can utilize JSTL template and taglib.
11 Oct 2019 by JImit Jani
you have to call Servlet from image src in jsp and set var path in QueryString put jsp like this.... servlet code this.filePath =request.getparameter('path');
11 Oct 2019 by Raghavendra M
I am trying to display an image throw jsp. Image is stored in local path so I wrote a servlet get method to retrieve image and in src attribute of image tag I am giving the servlet name and image path as parameter to servlet and here is my code,import java.io.BufferedInputStream;import...
24 Sep 2019 by Richard MacCutchan
Go to Trail: Getting Started (The Java™ Tutorials)[^]
24 Sep 2019 by Vipi VP
sir, I am new in jsp.. I got some error using javac file name following please help D:\Files\code\09-23-2019>javac Usage: javac where possible options include: -g Generate all debugging info -g:none Generate no debugging...
11 Sep 2019 by MadMyche
Well for starters you have invalid HTML; form nesting is generally prohibited Please select the option: Choose from the list MyReport...
11 Sep 2019 by Member 12974741
I have a jsp page here, the upload will show up based on one of the dropdown value. till there its working fine. I have used submit action for upload here. but also tried Ajax call etc...nothing working :( ideal goal is to upload file without submit action. Kindly assist how we can achieve this....
10 Mar 2019 by ramen79
I am having a data.json file containing... {"C13":0,"C24":0,"C35":0,"C46":0,"C57":0,"C12":105.23,"C23":0.18,"C34":124.3,"C45":132.49,"C56":145.39,"C14":60.46,"C25":0.18,"C36":84.3,"C47":93.24,"C58":97.7,"C1":146.78,"C2":0,"C3":94.15,"TS":"16:55:24"} now I have to get the values in...
10 Mar 2019 by Afzaal Ahmad Zeeshan
Because your object contains a property C1, not c1. JavaScript is case-sensitive, and you need to take care of that. Use this, var f = data.C1; Since your alert is showing undefined, it clearly means that the property is undefined, the object is not. If the data was undefined, it would have...
13 Feb 2019 by Han Bo Sun
In this tutorial, I am going to show the readers how to create an MVC application using Spring Boot, packaging as a self host WAR file, and execute using embedded Jetty application server.
14 Dec 2018 by Dhanyaal
The problem which I am having is; trying to convert get parameter string to int. I key getting the error " Cannot invoke trim() on the primitive type int " not sure what the problem is can someone help please. The line where I am getting the rrror on; id.trim().equals(123))) What I have...
14 Dec 2018 by OriginalGriff
What would you expect a Trim function to do an an integer value? It can't contain any whitespace at all, so there really isn't anything for it to do! Trim is exclusively a string based function: it removes whitespace from the start and end of the string. You cannot apply it to non-string based...
10 Dec 2018 by Dhanyaal
I am trying to parse json object and string it keeps throwing back an error. See line 136. I have also tried looking up on stackoverflow still nothing.: What I have tried: I have changed eval to json.parse: var films = JSON.parse("(" + rawData + ")"); Still nothing. Cant seem to fid out...
10 Dec 2018 by Afzaal Ahmad Zeeshan
You are injecting an invalid starter for the JSON document yourself, JSON.parse("(" + rawData + ")"); Your JSON documents can only start with {, or [, or they can have the data that they are representing—string, integer, whatever... RTFM. You can solve this problem by removing the...
30 Nov 2018 by User 14008390
FileUpload.jsp ...
2 Nov 2018 by Sriyashree Swain
I am a beginner in jsp and servlets. I want to stay in the same page and populate the dropdownlist but iam not able to so. I did it using scriplets and it happened but scriplets are deprecated long back. I just want to know more about servlet mapping in web.xml. I guess something is wrong with...
2 Nov 2018 by Richard Deeming
Quote: String query = "update cart" + name + " set productname="+productname+" ,productquantity=" + productquantity2 + " ,productsize = "+ productsize + " ,productcode = "+productcode+",imageurl="+imageurl+" where id=" + id2; That's not how parameters work. Your code is injecting the values...
2 Nov 2018 by User 14008390
i have created a table which is primary key on id(coloum) and i want to update it with query it is showing me Parameter index out of range (1 > number of parameters, which is 0).
2 Nov 2018 by Han Bo Sun
In this article, I will show the reader how to secure a web application based on Spring Boot and WAR archive, using the Spring Security and Tags. The application will have a login page, page access based on user roles, login failure, and access denied pages.
20 Oct 2018 by Member 14026945
The problem is that I am designing an online quiz application using jsp html and oracle database and I am using radio buttons for the options in mcqs.But I am not able to send the response that I chose as the answers of the questions to the next jsp page.Everytime it's showing null value in the...
17 Oct 2018 by Han Bo Sun
In this article, I like to discuss the way to set up a Spring Boot application that is packaged as a WAR archive and supports Spring MVC with JSP as view.
30 Sep 2018 by hareshdgr8
hi i am getting error that i install tomcat 7 in centos 7 in linux system on web and i want to configure for my jsp project i am getting error if i upload jsp file with it showing me same but in my desktop it showing me perfect value what type of...
6 Sep 2018 by @k5hu
I am new to Struts. I have installed all the struts2 plugins in Netbeans 8.1. The server that I'm using is Glassfish 4.1.1. When I run the following code I get: HTTP Status 500 - Internal Server Error type Exception report messageInternal Server Error descriptionThe server encountered an...
28 Aug 2018 by @k5hu
ConfigObject.jsp web.xml
20 Aug 2018 by Member 13955471
$( function() { $( "#slider-range" ).slider({ range: true, min: 0, max: 5000, values: [ 0, 0 ], slide: function( event, ui ) { $( "#amount" ).val( "$" + ui.values[ 0 ] + " - $" + ui.values[ 1 ] ); } }); $( "#amount" ).val( "$" +...
16 Aug 2018 by Member 9983063
Hello Guys am working on jsp project this project made by my seniors now they left and i really just little bit sound knowledge of jsp please help me when i run this project so am getting this errors please help how can i solve it. HTTP Status 500 - Unable to compile class for JSP: type...
16 Aug 2018 by Jerry Jeremiah
Shouldn't the import of com.apv.erp.resource.DbHandler be com.apv.erp.resource.DbHandler.* and the import of com.apv.erp.resource.PersistenceFactory be com.apv.erp.resource.PersistenceFactory.* ?
9 Aug 2018 by Member 9671810
cannot auto increment id in above code { String sql = "insert into artist_reg_ml (id,uname,pwd,email,country) values (?,?,?,?,?)"; PreparedStatement pst = conn.prepareStatement(sql); pst.setString(1, "5"); pst.setString(2, uname); ...
8 Aug 2018 by Yeswanth kumar Bandaru
My requirement is that the user will enter some data and using that I have to search in my Elastic Search database . here the problem is the number of records may be large in number . So I want to go with pagination . So now after user enters their data I will display the first 10 results...
26 Jun 2018 by Raghupathiraja
hi friends...i am new to java...i want to know that how can i perform sending mail from java application...give any idea...thanks in advance...
25 Jun 2018 by Richard MacCutchan
No wonder you have problems, that is such a bad way to use SQL. Use proper paramaterised queries so you can see the actual value of each parameter being passed to the statement. You also have two text strings beginning "INSERT", which have no meaning in Java.
25 Jun 2018 by Member 13887054
My code does not compile when I inserted the other tables and Im not really good at SQL statements and such. Is it possible if I can use a single query for inserting into multiple tables? Code below What I have tried:
2 Jun 2018 by megha more
Now i am working in jsp eclipse. Now i created connection to mysql database. but i can't insert value in database. please give the solution. My code is as below:
1 Jun 2018 by Jochen Arndt
This can't be answered without having deeper knowledge about your system. You should at least tell us what you have changed in which file and how the service is started / stopped on your system which depends on the used operating system and version. But even with that information it might be...
1 Jun 2018 by Member 9983063
Hello Guys, Recently am working on JSP project i am beginner in this platform but i have a project my senior done this but now i need to some editing in gui but the problem is i change the path in server file when i changed so apache tomcat service automatically stopped and not start again how...
30 May 2018 by Jochen Arndt
Please define "not working". It is your datatable and page so that nobody else can access it. You have to get meaningful error message to know what went wrong. That includes checking the parameters (are they present and valid), catching exceptions (like SQLException (Java Platform SE 7 )[^]...
25 May 2018 by Member 13845171
I want to use location variable inside scriptlet tag. What I have tried: i was tried request.getParameter and pageContext.getAttribute but it get only string not list it can't typecast also.
9 May 2018 by Richard MacCutchan
You cannot rely on finding that information on a user's system when they visit your website. And you should never try to access a user's registry. You need to install that program on your server, and run it there, after capturing the data parameters from the web page.
9 May 2018 by PEIYANGXINQU
When user visit my website and click the button,I want to start the Postman.exe.So I have to find the Postman install path.I have used the ocx and regedit commond to find the install path.But if the program do not write the infomation to the registry,How to find and start the program? Can I use...
6 May 2018 by Richard MacCutchan
String Message = "msg"; /*Set attribute msg of Message*/ request.setAttribute(Message, "msg"); // so the attribute name is "msg" ... String s = "msg"; if (s == request.getAttribute("Message")) // but the attribute name is not "Message" Your attribute names are...