Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!

Nash kumar

Greenhorn
+ Follow
since Sep 23, 2012
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Nash kumar

I am trying to validate date based on date entered in first textbox. If second textbox exceeds one year from the date entered in first textbox, then it should display an alert and blank the second date field textbox. Both the textboxes are readonly and gets the values from calender. I tried the below code and validation is not working. any help!


I am trying to validate row of textboxs. If any of the textbox values in that row are entered, then the user must enter all the textbox values in that row. It should also focus on the empty row. Else he should be able to submit the form. I tried the below code but it is looks like that there is a logic issue. Please let me know if any one can correct it. Thank you.

I never used JSTL or AJAX. I googled and tried using <C:out> to print the value. But It looks like I am making many mistakes with syntax and logic. Is it possible to give a small example using JSTL so that I can print the value. Thank u. Also Tried below code that didn't work.



4 years ago
JSP
Thank you for the reply. As I mentioned, it is an example code and not full code. If you help me with above code, then I can do the remaining code. I am using HTML to display the text values in textbox and not JSP tags. In this case, How I will I be able to Iterate?
4 years ago
JSP
I am trying to get the database values saved from form into Textbox in same form. The values are loaded whenever the form is loaded. I have written a example code what I am doing below. I have 5 rows of textboxes. I have written the below code that get the values from database. But my knowledge is limited about getting those five rows of values to the five rows of textboxes either using JSP or JAVAScript. Tried searching online but didn't fine related answer. Any help will be appreciated. Thank you.





4 years ago
JSP
com.abc.bulk package. This contains the servlet class file. (Download.java)
5 years ago
First I tried copying the servlet to the same folder as JSP file that didn't work. Getting the same class not found error .

Now, I tried creating a package and then changing the servlet mapping to below code. But not luck yet.

com.abc.bulk is the package name.

5 years ago
This is what I tried from FAQ.. Correct me if I am doing anything wrong.

Changed the JSP Code to :





Then got the below error.


javax.servlet.ServletException: Wrapper cannot find servlet class Download or a class it depends on
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
java.lang.Thread.run(Unknown Source)


root cause

java.lang.ClassNotFoundException: Download
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
java.lang.Thread.run(Unknown Source)

5 years ago
Could you please type the server-realtive URL for href value ? Thank you. It will be helpful.
5 years ago
I am trying to download excel file from server after clicking on a link. I have written the below JSP and Servlet code. JSP and Servlet are both in the same folder. I get the error "The requested resource (/BulkAccess/Download) is not available" after clicking on hyperlink to download the excel file. Any help?

JSP CODE


5 years ago
I have multiSelect drop down on my web page designed in JSP. End user will select required options and save the form to Database. Below is the original Dropdown that gets values and index from Database Master Table. Selected values are saved in another table.

Original Dropdown on the page.



Below code retrieve saved database values and display them as selected in new select tag. However, I want the selected values to be show in above table instead of new Dropdown.



5 years ago
JSP
I am uploading an excel file that has particular format. It has 11 columns and I want to read that excel and copy the columns to database except the heading. Database has below structure in ms-server 2008 and Excel has same number of columns and in that order.

If I print the data from above code, I'll get below output. Please help me in storing the below code to database.



CREATE TABLE [dbo].[BULK_ACCESS](
[EMP_ID] [int] NOT NULL,
[FNAME] [nvarchar](40) NULL,
[LNAME] [nvarchar](40) NULL,
[CATEGORY] [nvarchar](40) NULL,
[DEPARTMENT] [nvarchar](40) NULL,
[JTITLE] [nvarchar](40) NULL,
[REASON] [nvarchar](40) NULL,
[LMANAGER] [nvarchar](40) NULL,
[START_DATE] [date] NULL,
[END_DATE] [date] NULL,
[PROCESS_ID] [int] NULL
I am JAVA beginner. I am reading excel file using apachi POI and would like the results to be saved on to database. I read the excel file using below code and it display the code in console correctly.

I would like to write the code to Database and save all the data in a database. "stringCellValue" contains the data. How can I save the data to variables in order to save in Database?

Thank for the reply. I know how to use JDBC to insert values. Please help me how to save each cell value into a variable in order to insert them. Thank you.
5 years ago
I am a java beginner. I have the below file that reads excel file. Excel file has nine columns and I created a DB Table with 9 columns. I would like to read the excel file except the first row and write to database table. How to achieve this.



5 years ago