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

Hi - I wrote the below functions/html to create 10 more dropdowns upon clicking the button, but for some reason it is not working.
what am i doing wrong ?

My requirement:
I have 5 dropdowns on left side and right side by default
when i click on add 10 rows button i should see 10 more dropdowns on left side and 10 more  dropdowns on right side (total 15)

<!DOCTYPE html>
<html>
<body>

<script>
function addDataRows(divname) {
   var newDiv=document.createElement('div');
   var html = '<select>
		<option value="volvo">Volvo</option>
		<option value="saab">Saab</option>
		<option value="opel">Opel</option>
		<option value="audi">Audi</option>
		</select>';
   newDiv.innerHTML= html;
   document.getElementById(divname).appendChild(newDiv);
}
function addLRows(divname) {
   var newDiv=document.createElement('div');
   var html = '<select>
				<option value="volvo">Volvo</option>
				  <option value="saab">Saab</option>
				  <option value="opel">Opel</option>
				  <option value="audi">Audi</option>
				</select>';
   newDiv.innerHTML= html;
   document.getElementById(divname).appendChild(newDiv);
}
function add10rows(Container1, Container2){
	var rowCnt;
	for(rowCnt = 1; rowCnt<11; rowCnt++) {
		addDataRows(Container1)
		addLRows(LocContainer)
	}
}
</script>
<table>
<tr>
	<table>
		<td align="left" nowrap width="40%" style="padding-left: 10px; padding-bottom: 10px">
				<select>
				<option value="volvo">Volvo</option>
					<option value="saab">Saab</option>
				  

Open in new window

0
What does it mean to be "Always On"?
LVL 4
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

public ModelAndView EditDetails(Http Request req,Http Response res,SampleDTO sampleDTO)
{
ModelAndView mvc=new ModelAndView();
String n=req.getParameter("name");
List<String>details=//some list values;
mvc.addObject("details",details);
mvc.setviewname("ll.jsp");
return mvc;
}
 

in jsp , can u say how to use spring bind and set to dto and use it in controller
0
Query is

select to_char(to_date(123,'j'),'jsp')from dual;

Please tell me what is JSP and how it works
and why use date function
0
I have my code like below
      response = orch.process(request);

when i mover on to process method and click control and left mouse click it supposed to go to process method implementation but it is not doing in eclipse mars.

it used to work earlier not sure suddenly what happened stops working.

i restarted my laptop still not working.

please advise
0
<display:column url="/editFixedRonuAction.do" paramId="id"
                                                      media="html" paramProperty="ronuAreaCode" headerClass="listMenu"
                                                      titleKey="label.rnumberEdit">
                                                      <bean:message key="button.edit" />
                                                </display:column>

in above code,I want to pass ronuId and ronuAreaCode both variable to action class.

Please suggest solution
0
hidden field while scaning through hp fortiify
0
I am having a SOAP API project in which I send the request in XML while calling the API from SOAP UI to create the account on portal. In return, I get the response in XML.

Now I want to change it to Web UI (Don't want to use SOAP UI). To do that I want to use HTML form which will have input fields like v1:type,company name etc (Currently, I pass the fields in XML request using SOAP UI) and while submitting the form, API should be triggered and parse the XML response to display on Web UI.

Note : I am also having the certificate (jks) for API in SOAP UI. where that certificate will I configure?

Please help me as I am very new in this area.

Below is the request and response.

Request

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v="abc.com" xmlns:v1="abc.com">
   <soapenv:Header>
      <v:vfExtendedHeader>
         <v1:traceIdentifier>
            <v1:applicationId>VSDM_PROVISIONING</v1:applicationId>
            <v1:serviceId>ARI_sis_${=new java.text.SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'").format(new Date())}</v1:serviceId>
            <v1:serviceInterfaceVersion>2.0</v1:serviceInterfaceVersion>
            <v1:timestamp>${=new java.text.SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'").format(new Date())}</v1:timestamp>
            <v1:referenceId>ARI_rid_${=new java.text.SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'").format(new Date())}</v1:referenceId>
            <v1:correlationId>NULL</v1:correlationId>
      

Open in new window

0
getting HP fortify low issue Hidden filed in the below line in jsp .please help to solve

<input type="hidden" name="ProceedName" value=<%=pageReg%>>
0
hi does anyone know how to implement   marquee element in oracle java adf
0
how to insert multiple checkbox data into database table at the same id using jsp servlet?
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE
LVL 4
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

I'm looking to modify the Default Landing Zone of Open Meetings.  I'm looking for where in the open source code of this program that I can adjust sessions, invitations, meeting rooms, and the default landing zone upon entering the system.  I'm looking for some direction on this, and for any advice on which parts of the code or what source files that this might be coming from.  Please help.  Thank you!

David
0
I had this question after viewing Struts bean:define tag.
0
Hello,
I want to edit my adobe muse website's code on Netbeans and J2EE. I want to convert the HTML code of my site into a JSP I exported the HTML code of my site but don't know what to do next. Please help me
0
Hi,

I am new here. I was working on jsp pages and looking forward to implement a hiding function for a division based on if condition as shown below code:

<c:forEach items="${roleMapList}" var="item">
<c:if test="${item.rolemaproleid == 1 && item.rolemaproleid == 2 && item.rolemaproleid == 3}">
                           
/*  Here I have to implement code (jquery/javascript) to disable a div having an id= "hidingDiv"  */
                           
</c:if>
</c:forEach>

Could you please help me to surve for this day
0
This is my jsp page which display a quiz generated with random question.Now,my problem is i need to display the answr key of this quiz in the same order in which it is generated in the next jsp page and also compare the answer with the option chosen by the user.What should i do?????????
<html>
    <head>
    </head>
<body>
<%@page import="java.sql.*"%>

<form method="post" action="quizresult.jsp">
<table>
<%
Class.forName("com.mysql.jdbc.Driver").newInstance();
Connection connection = DriverManager.getConnection("jdbc:mysql://localhost/recruitment","root","amma");
Statement st=connection.createStatement();
//ResultSet rs=st.executeQuery("Select * from question ");
ResultSet rs=st.executeQuery("SELECT * FROM question ORDER BY RAND() LIMIT 5");
int i=1;
while(rs.next()){
%>
<tr><td><%=i%></td>
    <td><%=rs.getString("question")%></td></tr>
  <tr>  <td><input type="radio" value="<%=rs.getString("opt1")%>" name="radio<%=i%>"/><%=rs.getString("opt1")%></td></tr>
  <tr>   <td><input type="radio" value="<%=rs.getString("opt2")%>" name="radio<%=i%>"/><%=rs.getString("opt2")%></td></tr>
  <tr>   <td><input type="radio" value="<%=rs.getString("opt3")%>" name="radio<%=i%>"/><%=rs.getString("opt3")%></td></tr>
  <tr>   <td><input type="radio" value="<%=rs.getString("opt4")%>" name="radio<%=i%>"/><%=rs.getString("opt4")%></td></tr>


<%
i++;
}
%>
<tr><td><input type="submit" value="submit"></td></tr>
</table>
</form>
</body>
</html>
0
Hi,

what is the difference between remote vs local ejb. When to use which one and advantages, disadvantages, practical uses of each.

I am trying below example and author choose remote here which is not clear
http://www.ejbtutorial.com/j2ee/hello-word-tutorial-for-writing-stateless-session-enterprise-java-bean-ejb
As given below i created java project to access above ejb as jar

i included above ejb jar in build path i still get compilation error while recognizing Addition class and AdditionRemote interface as attached.

please advise on how to fix i9tremoteplease advise
build.png
0
Hi,

I spring application context.xml why we need proxy object as below


      <bean id="proxy" class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="target" ref="exampleBean"></property>
            <property name="interceptorNames">
                  <list>
                        <value>beforeAdv</value>
                  </list>
            </property>

what is the need of below property name
      <property name="interceptorNames">

where we supposed to use above property.

for @Around advise where below method is defined in API

obj=methodInvocation.proceed();
also for loggging why below method takes JointPoint as argument?
public void logBefore(JoinPoint joinPoint){


why we use
 <context:property-placeholder and jdbcTEmplate
and also
@ComponentScan
please advise
0
In spring ApplicationContext.xml why we mention scope like prototype, singleton etc as below.
            <bean id="obj" class="com.xyz.Welcome" scope="prototype"/>

which one to use which cases and what is the default value and advantages and disadvantages of each scope.
please advise
0
Hi,


spring ApplicationContext.xml  file why we alias name like below
      <alias name="student" alias="alias_stud"/>

i basically have student bean id with all its properties and additionally i have property called car as well within that(which is object has fields like model, type etc)

please advise
0
Industry Leaders: We Want Your Opinion!
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Hi,

I was  reading as below

Developing entity beans does not require a business interface; in fact, message-driven beans are the only EJBs that must implement some business interface.

from the link
http://www.javaworld.com/article/2071724/java-web-development/ejb-fundamentals-and-session-beans.html

i have not understood why enitiry beans do not require business interface whereas MDBs do.





what is Business interface and what are its uses.

When an EJB-based application needs to receive asynchronous messages from other systems, it can leverage the power and convenience of message-driven beans. Asynchronous messages between systems can be analogous to the events that are fired from a UI component to an event handler in the same JVM. For example, in the business-to-business (B2B) domain, a wholesaler could have an EJB application that uses message-driven beans to listen for purchase orders issued electronically from retailers.
how MDBs analogous to UI and same JVM?



Session beans are great at implementing business logic, processes, and workflow. For example, a StockTrader bean with buy() and sell() methods, among others, would be a good fit for a session bean.
Entity beans are the persistent data objects in an EJB application. In a stock trading application, a Stock bean with setPrice() and getPrice()methods would be an appropriate use of an entity bean. The buy() method of the previously
0
as you see on the picture how can I remove (tp1b)?
I want to run  http://localhost:8080/tp3 instead of  http://localhost:8080/tp1b

thanks
tp1b.png
0
We have 3 Dspace Apps deployed on Windows 2012 Server on Tomcat 8.5.1 with IIS 8 as Frontend using AJP 1.3 Connector. The applications have been configured to be accessed via port 8080, 8082, and 8083 respectively and their sites added to IIS. However, when accessed externally only the site on port 8080 shows properly, the other two show Tomcats default page. I have been on this for days now without much help. Can anyone bail me out: Further details below:

(1). Dspace apps are in their respective folders in tomcat/webapps folder. .
(2). Server.xml is configured as follows.
<?xml version="1.0" encoding="UTF-8"?>
<Server port="8005" shutdown="SHUTDOWN">
<Listener className="org.apache.catalina.startup.VersionLoggerListener" />    <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
<Listener      className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
<Listener lassName="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />    <GlobalNamingResources>
<Resource name="UserDatabase" auth="Container"
     type="org.apache.catalina.UserDatabase"
          description="User database that can be updated and saved"
          factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
          pathname="conf/tomcat-users.xml" />
</GlobalNamingResources>
<Service name="Catalina">
<Connector port="8009" protocol="AJP/1.3" 

Open in new window

0
I am having a difficult time finding a (commercial or open source) jquery event calendar that can be integrated with JEE application.
i did a quick search, was able to find: FullCalendar, dhtmlx-scheduler, Pikaday.  Any ideas? appreciated.
0
hi im trying to develop a crime system using netbeans and in my servlet i use jasper fill report method but when i compile i get the error error: no suitable method found for fillReport(String,Map<String,String>,Connection)
            JasperPrint jasperPrint = JasperFillManager.fillReport( path , parameterMap, connection );
                                                       ^
    method JasperFillManager.fillReport(String,Map<String,Object>,Connection) is not applicable
      (argument mismatch; Map<String,String> cannot be converted to Map<String,Object>)



C:\Users\NICK\Documents\NetBeansProjects\New folder\crime-reporting-system\src\java\reports\CrimeAtPlaceHTMLReportServlet.java:43: error: no suitable method found for fillReport(String,Map<String,String>,Connection)
		JasperPrint jasperPrint = JasperFillManager.fillReport( path , parameterMap, connection );
		                                           ^
    method JasperFillManager.fillReport(String,Map<String,Object>,Connection) is not applicable
      (argument mismatch; Map<String,String> cannot be converted to Map<String,Object>)
    method JasperFillManager.fillReport(InputStream,Map<String,Object>,Connection) is not applicable
      (argument mismatch; String cannot be converted to InputStream)
    method JasperFillManager.fillReport(JasperReport,Map<String,Object>,Connection) is not applicable
      (argument mismatch; String cannot be converted to JasperReport)
    method 

Open in new window

0
I am using Google Translate API and converting English data present in database to Chinese. In my jsp page(Result Screen browser) its coming properly but Once I click on Export to excel button chinese characters are not exporting properly.
So I am facing problem with Export to Excel Functionality.
Code for export To Excel Method:

            String filename = "Filename";
            response.setContentType("application/vnd.ms-excel;charset=UTF-8");
            response.setHeader("Expires", "0");
            response.setHeader("Cache-Control", "must-revalidate, post-check=0, pre-check=0");
            response.setHeader("Pragma", "public");
            response.setHeader("Content-Disposition", "attachment;filename=" + filename + ".xls");
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
>