[Last Call] Learn how to a build a cloud-first strategyRegister Now

x

JSP

JavaServer Pages (JSP) allow the development of dynamically generated web pages. It uses the Java programming language; JSP pages are translated into servlets at runtime, with each servlet being cached and reused until the JSP is modified. JSP allows Java code to be interleaved with static web markup content, so the resulting page can be compiled and executed on the server to deliver the content.

Share tech news, updates, or what's on your mind.

Sign up to Post

i works on an user registration process that involves sending automatic email with random URL for verification of user entered email address using java.
0
Important Lessons on Recovering from Petya
LVL 11
Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

HI Team,

I'm displaying  some database data of 5 columns(no,name,desg,sal,url) using JqGrid table in jsp.  I have added one submit button to each grid row. The data is displaying and the button is also added.I have written a js function(redirect(url)) . Now i want to invoke the js function by passing  'url'  column value as a parameter . How can i proceed?? Please help me
0
HI Team,

I developed JqGrid with spring MVC. When i run the application , the controller is not invoking.

my jsp:
---------
jQuery(document).ready(function() {
            $("#list").jqGrid({
                url:'/crud',
......

controller
__________

@Controller
@RequestMapping("/crud")
public class JqGridController {
    @Resource(name = "jqGridService")
    private IJqGridService jqGridService;

    @RequestMapping(method = RequestMethod.GET)
    public @ResponseBody CustomUserResponse getAll() {
        System.out.println("Received request to get all database records");
......

The  Sys.out() is not executing

Can any one help me??
0
I have an old Java web application that still uses Applets (not my decision).

After a recent Java upgrade (I believe it was 1.7 to 1.8) the app now throws a ClassNotFoundException and says that it can't find the JApplet class the Applet derives from before the Applet can load.

The path to the class is specified in a jsp page called loadApplet.jsp.

Here is the code in the loadApplet.jsp file. The only part that isn't an exact copy and paste is ThePathToTheJAppletClassWhichItAlwaysFoundBefore.class - which is just a string that defines where the package is.

<OBJECT classid = "clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" codebase = "https://java.sun.com/products/plugin/autodl/jinstall-1_4-windows-i586.cab#Version=1,4,0,0" height = "0" width = "0">
<PARAM NAME = "CODE"          VALUE = "ThePathToTheJAppletClassWhichItAlwaysFoundBefore.class" >
<PARAM NAME = "type"          VALUE = "application/x-java-applet;jpi-version=1.3.1" >
<PARAM NAME = "scriptable"    VALUE = "false" >
0
Hello all,

Currently, i am using smb server but now I want to change it into afp server.

what will be the exact way to change it and connect using afp server?

currently these library are used in the project:
import jcifs.smb.NtlmPasswordAuthentication;
import jcifs.smb.SmbFile;


Thanks in advance.

Regards
Amzad
1
hi am having this error when seting my java home am in window 7
[code]C:\Users\userpc>java -version
Error occurred during initialization of VM
Unable to load native library: Can't find dependent libraries


C:\Users\userpc>java -version
Error occurred during initialization of VM
Unable to load native library: Can't find dependent librarie

C:\Users\userpc>set JAVA_HOME=C:\java6

C:\Users\userpc>SET PATH=PATH%JAVA_HOME%\BIN;

C:\Users\userpc>JAVA -VERSION
'JAVA' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\userpc>java -version
'java' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\userpc>set JAVA_HOME=C:\java6

C:\Users\userpc>SET PATH=PATH%JAVA_HOME%/BIN;

C:\Users\userpc>java -version
'java' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\userpc>SET PATH=PATH%JAVA_HOME%;

C:\Users\userpc>java -version
'java' is not recognized as an internal or external command,
operable program or batch file.

Open in new window

[/code]
0
Dear Expert, I am facing the problem of inserting multiple checkbox values (retrieve from the database) then insert it into the child table. I getting an error.

TABLE SUBJECT THAT I ALREADY SET THEIR OWN ID (FIXED ID) (PARENT)
--------------------------
SUBJECTID                SUBJECTNAME
----------------            ------------------------------
PT3_ENGLISH            ENGLISH
PT3_BM                      BAHASA
PT3_SC                       SCIENCE
PT3_MATH                 MATHEMATICS

STUDENT TABLE SHOULD LOOK LIKE THIS. (CHILD)

STUDENTID                CATEGORY             SUBJECTID
----------------               -------------------         ----------------------------          
201734                        PT3                         PT3_ENGLISH            
                                                                     PT3_BM                      
                                                                     PT3_SC                      
                                                                     PT3_MATH

The scenario is when the student chooses service category. eg: PT3 . So that the student can choose multiple checkbox subjects.eg: english, math, sc, Bahasa.
The question: How can I do the multiple insert checkbox values into table in database.

here I am attaching my jsp registration.jsp



										 <div class="one_third first">Service Type:
										<select name="type" id="type" required>
												

Open in new window

0
I'm following this LDAP authentication code

LDAP Authentication code

replaced parameters with my own parameters to authenticate  with OpenLDAP 2.4.31


public static void main(String[] args)
	{
		String username = "jsmith";
		String password = "password@123"; 
		String base = "ou=people,dc=nodomain";
		String dn = "uid=" + username + "," + base;
		String ldapURL = "ldap://xx.xx.xx.xx:389";

		// Setup environment for authenticating
		
		Hashtable<String, String> environment = 
			new Hashtable<String, String>();
		environment.put(Context.INITIAL_CONTEXT_FACTORY,
				"com.sun.jndi.ldap.LdapCtxFactory");
		environment.put(Context.PROVIDER_URL, ldapURL);
		environment.put(Context.SECURITY_AUTHENTICATION, "simple");
		environment.put(Context.SECURITY_PRINCIPAL, dn);
		environment.put(Context.SECURITY_CREDENTIALS, password);

		try
		{
			DirContext authContext = 
				new InitialDirContext(environment);
			System.out.println("authentication success!");
			
			// user is authenticated
			
		}
		catch (AuthenticationException ex)
		{
			System.out.println("authentication failed!");   // I'm getting this print
			// Authentication failed

		}
		catch (NamingException ex)
		{
			ex.printStackTrace();
		}
	}
}

Open in new window


I am getting authentication failure message . ..what I'm doing wrong ?  ..unable to find the root cause.
Do I need to send password encrypted  ?
0
Dear,
What driver to choose below, when creating Database connection, to connect to SQL server DB?
18r.png
0
Hello,
facing a problem to choose best client side framework for localization with jsp?
I have REST API which i need to consume at client side and display it on jsp will it be safe to use spring mvc for client side?
What is the best practice to integrate client-server ?
0
New feature and membership benefit!
LVL 11
New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Hello,

Need to clean cache of client browser,using jsp as front end.
though have already written the below code

 <% response.setHeader("Cache-Control","no-cache"); //HTTP 1.1 
 response.setHeader("Pragma","no-cache"); //HTTP 1.0 
 response.setDateHeader ("Expires", 0); //prevents caching at the proxy server  
%>

Open in new window


But almost 90% of the times we need to ask the client to manually clean the cache,after that only the new changes are reflected in the client browser,say we have created new button on screen, which is not visible but when the user cleans the browser cache manually the button seems to work display.
0
Hi,

I have a requirement in Java script to run the select statements every 3 hours and update those select count(*) counts in a spreadsheet. Kindly share the code snippet to accomplish this request.

Also we are running

1. 2 scripts 3 hours once in a day.
2. 1 Script once in a day.
3. 1 script on particular times like 10.45, 11.15....

please let me know if you need any more details.

Thanks
Venkatesh.
0
how to export jsp content, (which will have html div and pie charts) to pdf/excel/csv..
any solution?
0
I want to develop charts in my project using jsp.
please suggest any open source which should have options to export to different formates.
0
Hi - I have the below line in my jsp and i am getting error saying
unterminated &lt;

 
var myString = "<img src='images/clear.gif' width='8' height='5'><mytags:dropdown  fieldID=" +"'"+ extDataID+ "'"+" category= " +  '<%=com.test.myString.GET_VALUE_TEST%>' + " selectedOption='' style='InputFields'/>";
			

Open in new window


so what is wrong in the above syntax is javascript not accepting <%= %>

I can pinpoint the error to this line because when i replace the above line with the below line no issues
var myString = "<img src='images/clear.gif' width='8' height='5'><input type='text' name=" +"'"+ test+ "'"+" maxlength = '40' size='64' value='' class = 'InputFields'>";

Open in new window


Thanks,
0
I am trying to create a dependent dropdown list. Right now in the masterDataQueryScreen.jsp, I am directly calling a method in in my MasterDataDao class called getAllSites. What I would like to do is create a dependent drop down list. So basically, if the division in the jsp has a value of either 33, 36, or 40 call the method getAllJJSites  in the MasterDataDao class to populate the second dropdown else call getAllSites. The getAllJJSites is on line number 642 in the MasterDataDao class. I have also included jquery-1.11.1.js under the js folder under WebContent. I am assuming I will need to use jquery. Please let me know what else is needed. Thank you so much in advance. I have been stuck on this issue for at least a month now and cannot find a great example using a query.
0
i have to represent no of device for each status(new,paired,blocked..etc) in the charts.
i want use  jquery and bootstrap with out using CanvasJS
please provide example of donut charts
0
I would like to see how to create a dependent dropdown list within my existing JSP page.
Basically, if I choose one value in the first dropdown list I would like to populate the second dropdown list with results from one query
else
I would like to populate the second dropdown list with results from another query.
I've heard jquery can do this but I have not found any examples related to query list results.
0
what kind of precautions we have to take while developing web application(JSP) to avoid/handle cross site scripting attacks.
we plan to use spring mvc framework as technology.
0
Concerto's Cloud Advisory Services
LVL 5
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

i want to implement report(charts) with JSP.. Inventory reports...SIM order reports.. should be exported to pdf and excel formate
i need some example charts for my reference.
please provide some references.
0
we have web portal, using Spring MVC.
we need to  Sending rest request to server from popup page(which as parent page)
we want to show messages to user about request status(sent successfully or not).. i need to achieve this with our refreshing page.

how can i achieve this.
0
Hi All,

I am having Issues trying to access a Tomcat JSP page from AWS ELB I can access it from the localhost,
but ELB isn't allowing me to get access out.

my EC2 Instance has security roles
HTTP 80 ::/0
HTTP 80 0.0.0.0/0
TCP 8095 0.0.0.0/0

The ELB has a listener for HTTP 80 HTTP 8095 with secturiy for
http 80 0.0.0.0/
TCP 8095 0.0.0.0/0
0
I have the following class definition:
class PurchaseData {
    public BigDecimal purchaseYears,
        contribRate,
        milYears,
        lapsedTime, lapsedTime2, lapsedTime3,
        factor,
        purchaseCost, purchaseCost2, purchaseCost3,
        paymentAmount;
    
    PurchaseData(BigDecimal py, BigDecimal cr, BigDecimal my,
        BigDecimal l1, BigDecimal l2, BigDecimal l3,
        BigDecimal f,
        BigDecimal p1, BigDecimal p2, BigDecimal p3,
        BigDecimal pa)
    {
        purchaseYears = py;
        contribRate = cr;  
        milYears = my;   
        lapsedTime = l1; 
        lapsedTime2 = l2;
        lapsedTime3 = l3;
        factor = f;
        purchaseCost = p1; 
        purchaseCost2 = p2;
        purchaseCost3 = p3;
        paymentAmount = pa;
    }
} 

Open in new window

Note that, all by itself, that class definition compiles w/o errors.

In my program I do the following:
PurchaseData rd = new PurchaseData();
//and I've tried:
PurchaseData rd = new PurchaseData(null,null,null,null,null,null,null,null,null,null,null);

Open in new window

when I try to run, I get:
org.apache.jasper.JasperException: Unable to compile class for JSP: 

An error occurred at line: 2,068 in the jsp file: /purchaseServiceCredit.jsp
The constructor purchaseServiceCredit_jsp.PurchaseData() is undefined

Open in new window

What am I doing wrong?
0
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@page import="java.sql.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%

Connection con = null;
Statement stmt = null;
ResultSet rs = null;


%>


<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<script type="text/javascript">
function lobChange(lob,chan){
	var lobvalue=document.getElementById(lob).value;
	alert(lobvalue);
	
}
</script>
</head>
<body>


<%
try{
	Class.forName("com.mysql.jdbc.Driver");
	con = DriverManager.getConnection(
			"jdbc:mysql://localhost:3306/usoutlookdb2017", "whirlpool",
			"whirlpool");
	stmt = con.createStatement();
	String sql = "SELECT distinct lob  FROM lob_sls_chan_mdata ";
	rs = stmt.executeQuery(sql);
}
catch(Exception e)
{
	e.printStackTrace();
}
%>
 
<label>LOB</label>
<select id="lob" name="lob" onchange="lobChange(this.id,'chan')">
<option>SELECT LOb</option>
	<%
		while (rs.next()) {
	%>
	<option><%=rs.getString(1)%></option>
	<%
		}
		
	%>
</select>


<br>
<label>CHANNEL</label> 
<select id="chan" name="chan"></select>


</body>
</html>

Open in new window

0
I'm very new to unifi, html and css. Please be gentle with me.
I have the current windows version of the Ubiquiti Unifi controller.
I am able to modify voucher.html and voucher.css to produce custom hotspot vouchers.
I want to print, on the voucher, the date and month the voucher was created.
I have added the following line to voucher.html:
<div class="create_time">Create Time: <unifi var="create_time" /></div>
 
The voucher prints "Create Time:" but does not print the date/time.
Any assistance is much appreciated.
0

JSP

JavaServer Pages (JSP) allow the development of dynamically generated web pages. It uses the Java programming language; JSP pages are translated into servlets at runtime, with each servlet being cached and reused until the JSP is modified. JSP allows Java code to be interleaved with static web markup content, so the resulting page can be compiled and executed on the server to deliver the content.

Top Experts In
JSP
<
Monthly
>