Search Results

Search found 1850 results on 74 pages for 'jsp'.

Page 21/74 | < Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >

  • How do I set up ServletForwardingController to intercept for jsp requests on weblogic

    - by dok
    My end goal is to be able to use the spring message tag with configured messageSource on a legacy app using a model-1 architecture. I've done this in tomcat with something like <bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource"> <property name="basename" value="WEB-INF/classes/bundle"/> </bean> <bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"> <property name="mappings"> <props> <prop key="*">myServletForwardingController</prop> </props> </property> </bean> <bean id="myServletForwardingController" name="/**/*.jsp" class="org.springframework.web.servlet.mvc.ServletForwardingController"> <property name="servletName" value="jsp"/> </bean> For weblogic I have <bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource"> <property name="basenames"> <list> <value>WEB-INF/i18n/bundle</value> </list> </property> </bean> <bean name="/**/*.jsp" class="org.springframework.web.servlet.mvc.ServletForwardingController"> <property name="servletName" value="JspServlet"/> </bean> But, no luck. I'm getting a StackOverflowError when I attempt to access a JSP. java.lang.StackOverflowError at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:620) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at weblogic.utils.classloaders.GenericClassLoader.defineClass(GenericClassLoader.java:338) at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:291) at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:259) at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:54) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:179) at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:35) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:620) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at weblogic.utils.classloaders.GenericClassLoader.defineClass(GenericClassLoader.java:338) at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:291) at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:259) at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:54) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:179) at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:35) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:683) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:552) at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:226) at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:124) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283) at weblogic.servlet.internal.ServletStubImpl.onAddToMapException(ServletStubImpl.java:394) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:309) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175) at weblogic.servlet.internal.RequestDispatcherImpl.invokeServlet(RequestDispatcherImpl.java:533) at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:266) at org.springframework.web.servlet.mvc.ServletForwardingController.handleRequestInternal(ServletForwardingController.java:129) at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153) at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:771) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:716) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:647) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:552) at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) ...

    Read the article

  • How to set cursor focus onload?

    - by eswaramoorthy-nec
    Hi, I use h:selectOneRadio tag. I need to set the cursor focus to first radio field. <f:view> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> </head> <body> <h:form id="focusForm" > <h:selectOneRadio id="testRadioId" value=""> <f:selectItem id="si1" itemLabel="JSF" /> <f:selectItem id="si2" itemLabel="JSP" /> </h:selectOneRadio> </h:form> </body></html></f:view> here The Firefox (browser) assign id :focusForm:testRadioId:0 that field. So i use the following script: document.getElementById("focusForm:testRadioId:0").focus(); But, Some times, i may change dynamically disable the radio field from backing bean. <h:selectOneRadio id="testRadioId" value=""> <f:selectItem id="si1" itemLabel="JSF" itemDisabled="true"/> <f:selectItem id="si2" itemLabel="JSP" /> </h:selectOneRadio> So here i disable the first radio button. Now, If i use the same script, then not set cursor focus to first radio field. how to handle this? that means how to alter my script dynamically during onload? Please help me. Thanks in advance.

    Read the article

  • IE7 issue - cannot download streamed file when Automatic prompting for file downloads is disabled

    - by Jai ganesh K
    Hi, My application is J2EE (JSP/Servlet) based. I encounter an issue when i try to open a new window (pop-up) from JSP and call a Servlet action (e.g. Streamer.do) which streams a PDF file inside that pop-up. Problem: While IE 7 - Tools - Internet Options - Security - Custom Level - Downloads - Automatic prompting for file downloads is Disabled and while pop-up window get opened, I am unable to download the file (Save/Open prompt is not comming up). In contrast, when I enable this option, I am able to download. But this option sometimes would be disabled in some environments. While testing this in Mozilla Firefox 3.0/3/5/IE6 it is working fine without any settings change. When i check it to enable i then get the Save/Open prompt to work correctly. This should be problem with IE7. Can anybody help us with Javascript or any working settings which doesnt care whether the "Automatic prompting for downloads" option in IE7 is enabled. Any help in this would be much appreciated. Regards! Jai

    Read the article

  • why cookie.getMaxAge() = -1?

    - by wavelet
    i have a test like this : cookie.jsp: <html> <head> </head> <body> <% String cookieName="SNS"; Cookie cookie=new Cookie(cookieName, "maxAgeTest"); cookie.setMaxAge(60*60); response.addCookie(cookie); %> </body> </html> and read.jsp is : <html> <head> </head> <body> <table border=1> <tr><td>Name</td><td>value</td></tr> <% Cookie cookies[]=request.getCookies(); Cookie sCookie=null; String svalue=null; String sname=null; int sage ; for(int i=0;i<cookies.length;i++) { sCookie=cookies[i]; svalue=sCookie.getValue(); sname=sCookie.getName(); sage=sCookie.getMaxAge(); %> <tr><td><%=sname%></td><td><%=svalue%></td><td><%=sage%></td></tr> <% } %> </table> </body> </html> but the result is : Name value maxAge JSESSIONID DB3561A47B37FCA8CA25EA04B80A26C7 -1 SNS maxAgeTest -1 why the maxAge is -1 ? and t test IE8,Chrome5,Safari ,the result same

    Read the article

  • passing data from a servlet to javascript code in an Ajax application ?

    - by A.S al-shammari
    I have a simple jsp/servlet application and I want to add AJAX feature to this app. I use JQuery , but it doesn't matter what javascript framework I use. This is my code: <script type="text/javascript"> function callbackFunction(data){ $('#content').html(data); } $('document').ready(function(){ $('#x').click(function() { $.post('/ajax_2/servlet',callbackFunction) }); }); </script> <body> <a href="#" id="x">Increase it</a> <div id="content"></div> </body> </html> Servlet HttpSession session = request.getSession(); Integer myInteger = (Integer)session.getAttribute("myInteger"); if(myInteger == null) myInteger = new Integer(0); else myInteger = new Integer(myInteger+1); session.setAttribute("myInteger", myInteger); response.getWriter().println(myInteger); The Question: I use out.print to transfer data from a servlet to javascript code (ajax code) , but If I have a complex structure such as Vector of Object or something like this , what is the best way to transfer the data? what about an XML file , JSON ? Is there any special jsp/servlets library to transfer data from a servlet to ajax application ? How can I parse this data in callbackFunction ?

    Read the article

  • genStrAsCharArray optimisation benefits

    - by Rich
    Hi I am looking into the options available to me for optimising the performance of JBoss 5.1.0. One of the options I am looking at is setting genStrAsCharArray to true in <JBOSS_HOME>/server/<PROFILE>/deployers/jbossweb.deployer/web.xml. This affects the generation of .java code from .JSPs. The comment describes this flag as: Should text strings be generated as char arrays, to improve performance in some cases? I have a few questions about this. Is this the generation of Strings in the dynamic parts of the JSP page (ie each time the page is called) or is it the generation of Strings in the static parts (ie when the .java is built from the JSP)? "in some cases" - which cases are these? What are the situations where the performance is worse? Does this speed up the generation of the .java, the compilation of the .class or the execution of the .class? At a more technical level (and the answer to this will probably depend on the answer to part 1), why can the use of char arrays improve performance? Thanks in advance Rich

    Read the article

  • Java: Tracking a user login session - Session EJBs vs HTTPSession

    - by bguiz
    If I want to keep track of a conversational state with each client using my web application, which is the better alternative - a Session Bean or a HTTP Session - to use? Using HTTP Session: //request is a variable of the class javax.servlet.http.HttpServletRequest //UserState is a POJO HttpSession session = request.getSession(true); UserState state = (UserState)(session.getAttribute("UserState")); if (state == null) { //create default value .. } String uid = state.getUID(); //now do things with the user id Using Session EJB: In the implementation of ServletContextListener registered as a Web Application Listener in WEB-INF/web.xml: //UserState NOT a POJO this this time, it is //the interface of the UserStateBean Stateful Session EJB @EJB private UserState userStateBean; public void contextInitialized(ServletContextEvent sce) { ServletContext servletContext = sce.getServletContext(); servletContext.setAttribute("UserState", userStateBean); ... In a JSP: public void jspInit() { UserState state = (UserState)(getServletContext().getAttribute("UserState")); ... } Elsewhere in the body of the same JSP: String uid = state.getUID(); //now do things with the user id It seems to me that the they are almost the same, with the main difference being that the UserState instance is being transported in the HttpRequest.HttpSession in the former, and in a ServletContext in the case of the latter. Which of the two methods is more robust, and why?

    Read the article

  • java web templates across multiple WAR files

    - by Casey
    I have a multi WAR web application that was designed badly. There is a single WAR that is responsible for handling some authorization against a database and defines a standard web page using a jsp taglib. The main WAR basically checks the privileges of the user and than based on that, displays links to the context path of the other deployed WARS. Each of the other deployed WARs includes this custom tag lib. I am working on redesigning this application, and one of the nice things that I want to retain is that we have other project teams that have developed these WAR modules that "plug into" our current system to take advantage of other things we have to offer. I am not entirely sure how to handle the page templates though. I need a templating system that would be easy enough to use across multiple wars (I was thinking of jsp fragments??). I really only need to define a consistent header and main navigation section. Whatever else is displayed on the page is up to the individual web project. Any suggestions? I hope that this is clear, if not I can elaborate more.

    Read the article

  • return ArrayList from spring controller for ajax call and render in second dropdown

    - by user1708125
    I've a spring bean with 3 Maps all of which are to be populated incrementally. First map is an item category list, second map is a product list and third map is a hobby for item type list All the maps are mapped to and on the JSP. When the page is loaded only the first map is populated on the onchange event of first map, I need to populate the second map in the bean and similarly on the onchange event of second map, I need to populate the third map in the bean. Is there a way to do this using Ajax?? I need some code samples to how to render JSON response in second and third dropdown. Clarification: @Donal: I have a simple JSP page with 3 dropdowns corresponding to 3 maps stored in my commandBean. So when the page loads for the first time only the first map and hence the first dropdown is populated. Now whenever the user selects anything out of the first dropdown, I need to send the same commandbean back with the values of the first dropdown and get the values for the second map and hence the second dropdown and so forth for the 3rd dropdown as well. For each dropdown I 've got 3 maps and 3 variables for storing the selected values. Now I want to understand if this is possible using Ajax. I hope this clarifies whatever you need to know. Thanx

    Read the article

  • CSS file in a Spring WAR returns a 404

    - by Rachel G.
    I have a J2EE application that I am building with Spring and Maven. It has the usual project structure. Here is a bit of the hierarchy. MyApplication src main webapp WEB-INF layout header.jsp styles main.css I want to include that CSS file in my JSP. I have the following tag in place. <c:url var="styleSheetUrl" value="/styles/main.css" /> <link rel="stylesheet" href="${styleSheetUrl}"> When I deploy the application, the CSS page isn't being located. When I view the page source, the href is /MyApplication/styles/main.css. Looking inside the WAR, there is a /styles/main.css. However, I get a 404 when I try to access the CSS file directly in the browser. I discovered that the reason for the issue was the Dispatcher Servlet mapping. The mapping looks as follows. <servlet-mapping> <servlet-name>Spring MVC Dispatcher Servlet</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping> I imagine the Dispatcher Servlet doesn't know how to handle the CSS request. What is the best way to handle this issue? I would rather not have to change all of my request mappings.

    Read the article

  • html/js: Refresh 'Select' options

    - by framara
    Hi, There's a class 'Car' with brand and model as properties. I have a list of items of this class List<Car> myCars. I need to represent in a JSP website 2 ComboBox, one for brand and another for model, that when you select the brand, in the model list only appear the ones from that brand. I don't know how to do this in a dynamic way. Any suggestion where to start? Thanks Update Ok, what I do now is send in the request a list with all the brand names, and a list of the items. The JSP code is like: <select name="manufacturer" id="id_manufacturer" onchange="return getManufacturer();"> <option value=""></option> <c:forEach items="${manufacturers}" var="man"> <option value="${man}" >${man}</option> </c:forEach> </select> <select name="model" id="id_model"> <c:forEach items="${mycars}" var="car"> <c:if test="${car.manufacturer eq man_selected}"> <option value="${car.id}">${car.model}</option> </c:if> </c:forEach> </select> <script> function getManufacturer() { man_selected = document.getElementById('id_manufacturer').value; } </script> How do I do to refresh the 'model' select options according to the selected 'man_selected' ?

    Read the article

  • jquery is getting the old values from database

    - by sansknwoledge
    hi in my jsp page i am a having a jquery area which pass the values to a servlet which returns an output of dropdownlist . then the jsp file do some updation so certain values which are in the dropdownlist should not be there while repopulating. but it is not happening. my jquery code is $("#cbocode").change(function(){ var cdid=$("#cbocode option:selected"); $.get("trnDC?caseNo=20&cdid="+cdid.text(),function(data){ $("#divinstrument").html(data); }) and the servlet code is case 20:{ //jquery call String cdid=(String) request.getParameter("cdid"); Statement st = con.createStatement(); ResultSet rs = st.executeQuery("select instrumentid from mstinstrument where codeid='" + cdid + "' and rec_Status='A' and statusid='U' and Agentid='METLAB'"); if (!rs.wasNull()){ //List data=new ArrayList(); String v="<select id=cboinstr>"; while (rs.next()) { // data.add(rs.getString("vend_code")); v += "<option>" + rs.getString("instrumentid").toString() + "</option>"; } v+="</select>"; response.setContentType("text/html"); PrintWriter out = response.getWriter(); out.print(v); } else{ response.setContentType("text/html"); PrintWriter out = response.getWriter(); out.print("no data found"); } where i am missing???

    Read the article

  • Getting rejected value null spring validation

    - by Shabarinath
    Hi in my project when I am trying to validate my form its not showing any error messages even if validation fails (Event Form is not submitted and enters into validation fail block) Here is my code /****************** Post Method *************/ @RequestMapping(value="/property", method = RequestMethod.POST) public String saveOrUpdateProperty(@ModelAttribute("property") Property property, BindingResult result, Model model, HttpServletRequest request) throws Exception { try { if(validateFormData(property, result)) { model.addAttribute("property", new Property()); return "property/postProperty"; } } /********* Validate Block *************/ private boolean validateFormData(Property property, BindingResult result) throws DaoException { if (property.getPropertyType() == null || property.getPropertyType().equals("")) { result.rejectValue("propertyType", "Cannot Be Empty !", "Cannot Be Empty !"); } if (property.getTitle() == null || property.getTitle().equals("")) { result.rejectValue("title", "Cannot Be Empty !", "Cannot Be Empty !"); } return (result.hasFieldErrors() || result.hasErrors()); } But when i debug i can see below one org.springframework.validation.BeanPropertyBindingResult: 1 errors Field error in object 'property' on field 'title': rejected value [null]; codes [Cannot Be Empty !.property.title,Cannot Be Empty !.title,Cannot Be Empty !.java.lang.String,Cannot Be Empty !]; arguments []; default message [Cannot Be Empty !] and this is how i am displaying in jsp file <div class="control-group"> <div class="controls"> <label class="control-label"><span class="required">* </span>Property Type</label> <div class="controls"> <form:input path="title" placeholder="Pin Code" cssClass="form-control border-radius-4 textField"/> <form:errors path="title" style="color:red;"/> </div> </div> </div> Event though when i see the below one when i debug (1 Error its correct) org.springframework.validation.BeanPropertyBindingResult: 1 errors Why it is not displayed in jsp can any one hep me?

    Read the article

  • Can't access a property with <html:checkbox property="..."> when iterating a list

    - by Bernhard V
    Hi. In my Struts form I've got a list. In a JSP I iterate over it like this: <c:forEach items="${MyForm.auspraegungen}" var="auspraegung"> <tr> <td>${auspraegung.name}</td> <td>${auspraegung.forced}</td> <td>${auspraegung.cbx_uebernehmen}</td> <html:checkbox property="auspraegung.cbx_uebernehmen" /> </tr> </c:forEach> Now the <html:checkbox isn't working. I'm always getting the following error: Caused by: javax.servlet.jsp.JspException: No getter method for property auspraegung.cbx_uebernehmen of bean org.apache.struts.taglib.html.BEAN But actually there is a getter for this property in my form class. It's written like this: public Boolean getCbx_uebernehmen() { return cbx_uebernehmen; } When I remove the checkbox it's also possible to display the property as in the <td>-tag above so I don't know where the problem is. Maybe I'm accessing it in the wrong way?

    Read the article

  • Seam/JSF/Facelets Compiler or Validator (equivalent of JspC for JSP)

    - by Drew
    Is there such a thing as JspC in the Seam/JSF/Facelets world? I used the Tomcat's JspC to validate a JSP/Struts application to validate if there are typos in the JSPs or some JSP was calling a Java function that didn't exist, etc. etc. From time to time I come across bugs in my current project (Seam/Facelets/RichFaces) where it's caused by a typo in action/value binding. And I think bugs like these can be caught using a program. Just wondering if someone has already written one. Basically a tool that can validate if the method/value binding are correct. I know this would be specially hard in Seam since names are Context sensitive and the tool should somehow figure out what the context is. But I think it should be easier to just check if the names are valid and the Objects bound to those names have the methods and/or properties being referred to in the JSF page. Thanks

    Read the article

  • j2me or android file upload to jsp

    - by user313613
    hi i new to mobile development i like to upload the file from blackberry and android how to develop the mobile side to this jsp page. please do reply me thanks here i mention the jsp file from roseindia.net. <%@ page import="java.io.*" % <% //to get the content type information from JSP Request Header String contentType = request.getContentType(); //here we are checking the content type is not equal to Null and as well as the passed data from mulitpart/form-data is greater than or equal to 0 if ((contentType != null) && (contentType.indexOf("multipart/form-data") = 0)) { DataInputStream in = new DataInputStream(request. getInputStream()); //we are taking the length of Content type data int formDataLength = request.getContentLength(); byte dataBytes[] = new byte[formDataLength]; int byteRead = 0; int totalBytesRead = 0; //this loop converting the uploaded file into byte code while (totalBytesRead < formDataLength) { byteRead = in.read(dataBytes, totalBytesRead, formDataLength); totalBytesRead += byteRead; } String file = new String(dataBytes); //for saving the file name String saveFile = file.substring(file.indexOf("filename=\"") + 10); saveFile = saveFile.substring(0, saveFile.indexOf("\n")); saveFile = saveFile.substring(saveFile.lastIndexOf("\\") + 1,saveFile.indexOf("\"")); int lastIndex = contentType.lastIndexOf("="); String boundary = contentType.substring(lastIndex + 1, contentType.length()); int pos; //extracting the index of file pos = file.indexOf("filename=\""); pos = file.indexOf("\n", pos) + 1; pos = file.indexOf("\n", pos) + 1; pos = file.indexOf("\n", pos) + 1; int boundaryLocation = file.indexOf(boundary, pos) - 4; int startPos = ((file.substring(0, pos)).getBytes()).length; int endPos = ((file.substring(0, boundaryLocation)) .getBytes()).length; // creating a new file with the same name and writing the content in new file FileOutputStream fileOut = new FileOutputStream(saveFile); fileOut.write(dataBytes, startPos, (endPos - startPos)); fileOut.flush(); fileOut.close(); %><Br><table border="2"><tr><td><b>You have successfully upload the file by the name of: <% out.println(saveFile); % <% } %

    Read the article

  • Map a struts2 action result to a controller instead of a jsp

    - by Jim
    Hello, I'm working on on a site built using struts2. The vast majority of our targets generate xml, so mapping the result to a jsp page makes sense. A couple of our targets actually generated binaries. I'm wondering if there is a convenient way to say that the result should come from a servlet/controller instead of a jsp. Obviously this could be done by modifying the web.xml so the struts filter doesn't apply to those targets and mapping those targets as servlets, but this is non-ideal. Currently, the struts filter applies to the entire site, and we would like to keep it that way. Ideas? Thanks!

    Read the article

  • How easy would it be to refactor a small JSP/Servlet/JDBC project to SpringMVC/Hibernate

    - by John
    With reference to this post, I am considering starting a new web-based Java project. Since I don't know Spring/Hibernate I was concerned if it's a bad plan to start learning them while creating a new project, especially since it will slow down the early development. One idea I had was to write a prototype using tech I do know, namely JSP/Servlets/JDBC, since I can get this running much quicker with my current knowledge. I could then throw the whole thing away and start over with Spring, etc, but I'd like to consider how easy it would be to refactor a smallish project from JSP/Servlets/JDB to SpringMVC/Hibernate? My DB could of course be re-used but what about other code... would I expect to save most of it plugged into an MVC framework, or is the paradigm shift big enough this would cause more trouble than it avoids? Please use the other question for more general advice on choosing technologies

    Read the article

  • Redirecting users in JSP from within a includes - java syntax error

    - by Mark Hazlett
    Hey everyone, So my setup for my web application is that I have a general header and footer and then I just include them in all my other pages so that all the common elements for all the pages are in a single page. The only problem I'm running into is when I want to redirect the user back to a login page if the "username" session has not already been created. The problem that I"m running into is that I have an if statement at the top of my header.jsp and then I have the else in the footer.jsp and it is giving me a java syntax error. Any ideas? Here is the code I'm referring to... <%@page contentType="text/html" pageEncoding="UTF-8"%> <% if(session.getAttribute("username") != null) { %> <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <!-- CSS files --> <link rel="stylesheet" href="../CSS/headerStyle.css" type="text/css" media="screen" /> <title>Insert title here</title> </head> <body> <div id="container"> <div id="header"> <div id="headerTitle">Title</div> </div> </div> <%} %> And then here is the footer <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link rel="stylesheet" href="../CSS/headerStyle.css" type="text/css" media="screen" /> </head> <body> <div id="footer"></div> </body> </html> <% else { response.sendRedirect("../wa_login/login.jsp"); } %> However it is giving me an error on the else statement because the else doesn't have an if statement because it's in the header file.

    Read the article

  • AJAX call + JQuery Dialog Title changing dynamically

    - by Panther24
    I have an AJAX call which loads an Dialog page, now depending upon the content of the data returned on the AJAX call, I want to change the title of the Window, how do I do that. Here is the snippet of code: var divid = "brHistoryForm"; var url = "getRestoreFiles.action?profileName="+profileName; // Create xmlHttp var xmlHttp = AJAX(); // The code... xmlHttp.onreadystatechange=function(){ if(xmlHttp.readyState==4){ document.getElementById(divid).innerHTML=xmlHttp.responseText; } } xmlHttp.open("GET",url,true); xmlHttp.send(null); $('#brHistoryForm').dialog('open'); jQuery('#brHistoryForm').focus(); document.getElementById('pageTitle').innerHTML = "<h2>"+profileName+" - B&R History</h2>" Here 'pageTitle' is a div. When I run the above piece of code, it opens a dialog window, the action is redirected to a jsp page which is loaded inside the div. It works fine, but the title does not get set :(. I've tried to do the setting of the title in the redirected jsp page, it doesn't work either. Here is the code of that JSP page: <%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <%@ taglib prefix="s" uri="/struts-tags" %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>B&R History</title> </head> <body> <table style="width: 100%"> <tr> <td style="width: 40%"> <div id="pageTitle"> <h2>B&R History</h2> </div> </td> </tr> </table> <table id="diskTable" cellpadding="0" cellspacing="0" border="1" class="display"> <thead> <tr> <th>Select</th><th>Operation</th> <th>Source</th><th>Destination</th> <th>Status</th><th>Start Time</th><th>End Time</th> </tr> </thead> <tfoot></tfoot> <tbody> <s:iterator value="restoreFileList"> <tr> <td> <s:if test="%{status.equals('Finished')}"> <input onClick="loadRestoreForm('<s:property value="name"/>', '<s:property value="to_path"/>', '<s:property value="status"/>')" type="radio" name='chk' id="chk" value="<s:property value='id'/>,<s:property value="status"/>" > </s:if> <s:else> <input type="radio" name='chk' id="chk" value="<s:property value='id'/>,<s:property value="status"/>" disabled> </s:else> </td> <td> <s:if test="%{br_type == 0}"> Backup </s:if> <s:else> Restore </s:else> </td> <td><s:property value="from_path"/></td> <td><s:property value="to_path"/></td> <td><s:property value="status"/></td> <td><s:property value="start_time"/></td> <td><s:property value="end_time"/></td> </tr> </s:iterator> </tbody> </table> </body> </html> Any help would be appreciated.

    Read the article

  • Tomcat 6: Access Control Exception?

    - by iftrue
    I'm trying to setup a tomcat6 server, and I'm trying to match another setup someone else established. However, my deployment (default Ubuntu install) uses a policy.d/ directory structure, and the established server just uses a catalina.policy file. I've tried setting every entry in policy.d to match the given catalina.policy, but I still get the following stacktrace on boot (from localhost log). I have two questions, then. First, how do I get tomcat to use a single poilcy file, rather than the directory structure presented by policy.d/? Secondly, why, when I specify all files to use the same policy, do I still get the stack trace below? Stack trace: SEVERE: Servlet /myapp threw load() exception java.security.AccessControlException: access denied (java.lang.RuntimePermission accessClassInPackage.org.apache.jasper) at java.security.AccessControlContext.checkPermission(AccessControlContext.java:342) at java.security.AccessController.checkPermission(AccessController.java:553) at java.lang.SecurityManager.checkPermission(SecurityManager.java:549) at java.lang.SecurityManager.checkPackageAccess(SecurityManager.java:1529) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:291) at java.lang.ClassLoader.loadClass(ClassLoader.java:264) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1314) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1245) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:332) at org.apache.jasper.servlet.JspServlet.init(JspServlet.java:100) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:244) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAsPrivileged(Subject.java:537) at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:276) at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162) at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:115) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1166) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:992) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4058) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4367) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791) at org.apache.catalina.core.ContainerBase.access$000(ContainerBase.java:123) at org.apache.catalina.core.ContainerBase$PrivilegedAddChild.run(ContainerBase.java:145) at java.security.AccessController.doPrivileged(Native Method) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:769) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:978) at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:941) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:499) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1201) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:318) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053) at org.apache.catalina.core.StandardHost.start(StandardHost.java:719) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:516) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:578) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at org.apache.commons.daemon.support.DaemonLoader.start(DaemonLoader.java:177) Policy.d grant codeBase "file:${java.home}/lib/-" { permission java.security.AllPermission; }; // These permissions apply to all shared system extensions grant codeBase "file:${java.home}/jre/lib/ext/-" { permission java.security.AllPermission; }; // These permissions apply to javac when ${java.home] points at $JAVA_HOME/jre grant codeBase "file:${java.home}/../lib/-" { permission java.security.AllPermission; }; // These permissions apply to all shared system extensions when // ${java.home} points at $JAVA_HOME/jre grant codeBase "file:${java.home}/lib/ext/-" { permission java.security.AllPermission; }; // ========== CATALINA CODE PERMISSIONS ======================================= // These permissions apply to the daemon code grant codeBase "file:${catalina.home}/bin/commons-daemon.jar" { permission java.security.AllPermission; }; // These permissions apply to the logging API grant codeBase "file:${catalina.home}/bin/tomcat-juli.jar" { permission java.util.PropertyPermission "java.util.logging.config.class", "read"; permission java.util.PropertyPermission "java.util.logging.config.file", "read"; permission java.io.FilePermission "${java.home}${file.separator}lib${file.separator}logging.properties", "read"; permission java.lang.RuntimePermission "shutdownHooks"; permission java.io.FilePermission "${catalina.base}${file.separator}conf${file.separator}logging.properties", "read"; permission java.util.PropertyPermission "catalina.base", "read"; permission java.util.logging.LoggingPermission "control"; permission java.io.FilePermission "${catalina.base}${file.separator}logs", "read, write"; permission java.io.FilePermission "${catalina.base}${file.separator}logs${file.separator}*", "read, write"; permission java.lang.RuntimePermission "getClassLoader"; // To enable per context logging configuration, permit read access to the appropriate file. // Be sure that the logging configuration is secure before enabling such access // eg for the examples web application: // permission java.io.FilePermission "${catalina.base}${file.separator}webapps${file.separator}examples${file.separator}WEB-INF${file.separator}classes${file.separator}logging.properties", "read"; }; // These permissions apply to the server startup code grant codeBase "file:${catalina.home}/bin/bootstrap.jar" { permission java.security.AllPermission; }; // These permissions apply to the servlet API classes // and those that are shared across all class loaders // located in the "lib" directory grant codeBase "file:${catalina.home}/lib/-" { permission java.security.AllPermission; }; // ========== WEB APPLICATION PERMISSIONS ===================================== // These permissions are granted by default to all web applications // In addition, a web application will be given a read FilePermission // and JndiPermission for all files and directories in its document root. grant { // Required for JNDI lookup of named JDBC DataSource's and // javamail named MimePart DataSource used to send mail permission java.util.PropertyPermission "java.home", "read"; permission java.util.PropertyPermission "java.naming.*", "read"; permission java.util.PropertyPermission "javax.sql.*", "read"; // OS Specific properties to allow read access permission java.util.PropertyPermission "os.name", "read"; permission java.util.PropertyPermission "os.version", "read"; permission java.util.PropertyPermission "os.arch", "read"; permission java.util.PropertyPermission "file.separator", "read"; permission java.util.PropertyPermission "path.separator", "read"; permission java.util.PropertyPermission "line.separator", "read"; // JVM properties to allow read access permission java.util.PropertyPermission "java.version", "read"; permission java.util.PropertyPermission "java.vendor", "read"; permission java.util.PropertyPermission "java.vendor.url", "read"; permission java.util.PropertyPermission "java.class.version", "read"; permission java.util.PropertyPermission "java.specification.version", "read"; permission java.util.PropertyPermission "java.specification.vendor", "read"; permission java.util.PropertyPermission "java.specification.name", "read"; permission java.util.PropertyPermission "java.vm.specification.version", "read"; permission java.util.PropertyPermission "java.vm.specification.vendor", "read"; permission java.util.PropertyPermission "java.vm.specification.name", "read"; permission java.util.PropertyPermission "java.vm.version", "read"; permission java.util.PropertyPermission "java.vm.vendor", "read"; permission java.util.PropertyPermission "java.vm.name", "read"; // Required for OpenJMX permission java.lang.RuntimePermission "getAttribute"; // Allow read of JAXP compliant XML parser debug permission java.util.PropertyPermission "jaxp.debug", "read"; // Precompiled JSPs need access to this package. permission java.lang.RuntimePermission "accessClassInPackage.org.apache.jasper.runtime"; permission java.lang.RuntimePermission "accessClassInPackage.org.apache.jasper.runtime.*"; // Precompiled JSPs need access to this system property. permission java.util.PropertyPermission "org.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER", "read"; };

    Read the article

< Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >