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'd like to create a web page (using jsp) with a touch-screen table that can accept graphical input, like a signature or doodle. I'm cluless as to what's needed or where to start. Advice?
0
Free Tool: SSL Checker
LVL 12
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Are these same in Drools  ?

code -1 :

when
    $city : City()  
   
then
    //Do something
end

Open in new window



code -2 :

when
    city : City()  
   
then
    //Do something
end

Open in new window


Note ..they are differed by "$" only.

I have seen two such versions  in Drool like above............sometimes  we use  "$"  and sometimes  without "$"  . Do they mean same thing  ?
0
I have  a  jsp based application  and I want to deploy under  Apache server . How to configure  to access that jsp  application ?
0
I have a function, referenced by numerous other programs, whose parameters are not able to be changed:

static void reportDetail(Statement stmt, BufferedWriter outFile, String detailColumn) throws Exception

However, the body of the function is defined locally in any given program. What I need to do in one particular program is reference a string defined in the main program, e.g.:

String localVar = globalVar;

where globalVar is defined outside the scope of reportDetail().

Is there a way to do this? (this is jsp BTW)
0
We have a JSP web app (runs on Tomcat on Windows) that needs to do file read/writes.  We want to distribute the web servers, but need a central file server so we know we're going to introduce latency as it reads/writes to the shared folder (\\server\folder type sharing via SMB).

Is there some sort of document or any good articles on the latency ceiling for this?  I expects it's not a hard limit, but just that at some point the latency/bandwidth leads to the process taking longer and hence more web server resources will be consumed (from the users making the requests that lead to this read/write).  Probably mainly memory for the threads/code running while they're running.  What I'm trying to find is anything about failures.  For instance if reading a 50 k file is making calls and there's 1000 ms or 2000 ms or etc. what's the effect of that.  Is there a point (3000 ms latency) or other things of that sort at which point the read/write will generate errors (in other words timeouts and such).
0
I am struggling with a problem on JSF Primefaces 6.0 where in I have main page which has the list of addresses and main save button. The list of addresses in displayed in data table and the user can click on the edit button to edit any row of the data table. The edit button opens a dialog popup where user can change the address attributes and the click on "OK" button which should updated the list grid data as well as updated the address object in the listgrid of the main bean.
Currently I am facing the problem where my changes in the address popup are not visible in the backing bean method.


Sample code :-

<main:form>
      <addresslistTable> bean:addressList
            <addressline1> value="variable.addressline1" onclick--> bean.getAddressById(variable.id)
      </addresslistTable>
</main:form>

<addressDialog:form>
      <addressline1> value="bean.otherAddress.addressline1"  --> user can change this value
      <p:commandButton value="#{msg.common_save}" process="@this" action="#{bean.submit}" update=":main:addresslistTable" oncomplete="PF('addressDialog').hide()"/>
</addressDialog:form>




class bean {
Address otherAddress;


public getAddressById(addressId){
      otherAddress = getAddressFromDatabaseById(addressId);
}


public void submit(){
// here I am accesing the otherAddress.addressLine1 which is still showing be the old value

}

}
samplecode.txt
0
I have hyperlink in a jsp page that calls a javascript (<a href="javascript:somefunction()" > Save </a> )

someFunction() is in same jsp, but the function body contains methods from another.js file.

In Mozilla ESR onblur and onclick event is executing simultaneously.

But, in Chrome and IE it is working fine.

Can someone please help on this ?
0
how to check domain name availability in javascript using jsp
0
Hi Team,

Im using jqgrid table in a jsp page. the data is displaying correctly. but the  entire table was not displayed according to the page. it was not expanded.I verified with Developer tools in chrome. I came to know that the table width is set to 1px. If i uncheck this, the table is displaying correctly. The how to overcome this width:1px?
0
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
Free Tool: Site Down Detector
LVL 12
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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
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
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
The 14th Annual Expert Award Winners
LVL 7
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

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

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
>