answersLogoWhite

0


Best Answer

You can set the value in the hidden form fields using javascript and access the form fields in JSP

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you transfer values from javascript to JSP?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Can insert javascript coding in servlet?

No. Javascript code can be present inside a JSP but not inside a servlet. A Servlet is a pure java class.


Difference between JSP and JAVA Script?

Hi, 1. JSP is a server side scripting while Javascript is as client side scripting language. 2. JSP also connects with database to fetch up the records from the database while javascript can be used for validate the code on client side.


How do you convert HTML to JSP?

You cannot. A JSP Page contains a lot more contents than just HTML. It contains JavaScript, Java Scriptlets etc. So a HTML cannot be directly converted to a JSP unless someone sits and adds the other contents to the JSP that makes it a JSP


What is the difference between script and scriptlet?

"script" is an HTML tag used to include JavaScript on a web page. Example: <HTML> <body> <script type="text/javascript"> document.write("hi there"); // javascript interpreted by the browser </script> </body> </HTML> "Scriptlet" is a JSP construct used to include Java in a JSP page. Example: <HTML> <body> <% // this is a scriptlet response.getWriter().write("hi there"); // Java executed on the server %> </body> </HTML> Here the result (an HTML document with the text "hi there") is the same in both cases, but the mechanisms are different - Javascript runs in the browser (any browser), while the JSP scriptlet is executed on the server and needs a server with JSP support. See related links.


How validate and retrieve data from database in jsp?

We can do validation by using JavaScript. Here we are using function Validate(). Iam creating one JSP name index.jsp & give a link to another JSP name basic.jsp. In that Jsp iam using Type 1 Jdbc Driver & giving a database connection


What is the difference between requestgetattribute and requestgetParameter in JSP?

request.getAttribute() is used on the Server side Java code to get values submitted from the form onto the Servlet or other java classes request.getParameter() is used on the JSP page to get values sent by the servlet and display it in the jsp page


What is the difference between JS and JSP?

JS stands for JavaScript whereas JSP stands for Java Server Pages. JS is a scripting language that can be used in HTML and other Web related UI pages whereas JSP is a full fledged technology which is used to build complex and powerful UI web pages. JSP has support for JS too.


How the data is viewed in a JSP in the form of table?

You can display data in Tabular format in a JSP page using the HTML <Table> Tag. You can even assign dynamic values to the table using JSP Scriptlets. <% %>


How does the javascript function performs the validation check?

JavaScript can do the validation checks easily. All you have to do is provide the values you want to validate.


What is the difference between JSP hosting and other kinds of hosting?

The main difference between JSP hosting and other kinds of hosting is simply the use of Javascript. While some things may differ between the different types, there are also a lot of similarities.


Describe jsp processing?

JSPs are converted to servlets before the container runs them. This is actually cool because you don't need hardcore java programming skills to create a JSP page whereas you'll need them to write a servlet. Moreover, all you'll need to write a JSP is some expertise in creating HTML files and in using JavaScript. You can create front-end JSP pages without having much expertise in Java at all. Although JSP reduces the required skill level, JSP becomes a servlet, with the nice performance and portability benefits.


Difference between java script and java server page?

JavaScript and JavaServer Pages (JSP) serve different purposes and operate in different environments within web development. Here are the key differences between them: Language Type and Purpose: JavaScript: JavaScript is a client-side scripting language. It is used primarily to make web pages interactive and to create dynamic content that runs in the user's web browser. It is embedded directly into HTML and is executed on the client's side. JSP (JavaServer Pages): JSP is a server-side technology. It is used to create dynamically generated web pages based on HTML, XML, or other document types. JSP allows embedding Java code into HTML pages and is executed on the server side before the page is sent to the client's browser. Execution Environment: JavaScript: Runs in the browser on the client side. It interacts with the Document Object Model (DOM) of the web page and can be used to handle events, validate forms, and update the content of a web page without requiring a full page reload. JSP: Runs on the server. When a web page request is made, the JSP engine on the server processes the embedded Java code and produces an HTML page (or other document types) to send back to the client's browser. Syntax and Integration: JavaScript: Uses a syntax based on the ECMAScript standard. It is often used in conjunction with HTML and CSS to create interactive web pages. JavaScript code is included directly within HTML files using the tag or in separate .js files. JSP: Uses Java code within HTML tags, utilizing JSP-specific tags and expressions. It allows for the inclusion of JavaBeans, custom tags, and servlets. JSP files typically have a .jsp extension. Use Cases: JavaScript: Ideal for tasks that require immediate interaction with the user, such as form validation, animations, handling user inputs, and making asynchronous requests (AJAX) to update content without refreshing the page. JSP: Suitable for generating dynamic web content on the server side, such as fetching data from a database, performing business logic, and preparing content before it is sent to the client. It is often used in conjunction with Java Servlets and frameworks like JavaServer Faces (JSF) or Spring MVC. Dependency: JavaScript: Does not depend on a specific server technology. It runs in the browser and can work with any server-side technology or static HTML files. JSP: Requires a Java-enabled server, such as Apache Tomcat, Jetty, or IBM WebSphere, to compile and execute the JSP code on the server side. In summary, JavaScript and JSP are fundamentally different technologies designed for different aspects of web development. JavaScript enhances the interactivity and user experience on the client side, while JSP handles the generation of dynamic content on the server side before delivering it to the client's browser.