Search Results

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

Page 2/74 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Including Applet in JSP page

    - by Hara Chaitanya
    Hi everyone, I wrote an Applet program which draws a pie chart. The values for the applet should be passed from JSP page. I wrote the following lines of code in JSP jsp:plugin type="applet" code="drawPie" codebase="." width="750" heigth="300" jsp:params jsp:param name="user_id" value="<% =user %" /jsp:params /jsp:plugin and in applet i used String user=getParameter("user_id"); when i open the jsp page nothing comes neither error nor the chart ........ What is the problem/error in the above code snippet.....

    Read the article

  • Cache JSP based on URL parameter

    - by Satheesh
    I have a jsp file pageshow.jsp and the parameter id, Is there any way to cache the jsp file in server-side based on the url parameter Requesting page pageshow.jsp?id=100 get from cache instead of building from server Requesting page pageshow.jsp?id=200 get from cache instead of building from server Above two pages should have different cache content since their parameter are different This may avoid the rebuilding the jsp file in server side and also decrease the server load

    Read the article

  • Building non (jsp/freemarker) template based website [on hold]

    - by Ismail Marmoush
    If my web app is supposed to work in one page, something like asana.com, and I wanted to make the whole website free of templates, meaning I would serve data and make js/mobile app call them, or even let other developers create new interfaces for it. So is it acceptable to have such a design for such a problem ? or you think I would eventually have use jsps/freemarker for a certain case. I found something when I started asking the right questions, here is it wiki: Single Page Application

    Read the article

  • Jetty 7 hightide distribution, JSP and JSTL support

    - by Lior Cohen
    Hello guys. I've been struggling with Jetty 7 and its support for JSP and JSTL. My JSP file: <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <head> <title>blah</title> </head> <body> <table id="data"> <tr class="columns"> <td>Hour</td> <c:forEach var="campaign" items="${campaigns}"> <td>${campaign}</td> </c:forEach> </tr> <c:forEach var="hour" items="${results}"> <tr> <td class="hour">${hour.key}</td> <c:forEach var="campaign" items="${campaigns}"> <td>${hour[campaign]}</td> </c:forEach> </tr> </c:forEach> </table> </body> </html> The JSP portions above work as expected. JSTL, however, does not. The campaigns and results variables are request attributes set by a servlet. I get the following errors: WARN: ... compiler.TagLibraryInfoImpl: Unknown element (deferred-value) in attribute WARN: ... compiler.TagLibraryInfoImpl: Unknown element (deferred-value) in attribute WARN: ... compiler.TagLibraryInfoImpl: Unknown element (deferred-value) in attribute ERROR: ... javax.servlet.ServletException: java.lang.AbstractMethodError: javax.servlet.jsp.PageContext.getELContext()Ljavax/el/ELContext; I am not bundling any jar files into my .war file deployed to jetty. The version of jetty I'm using is: jetty-hightide-7.0.1.v20091125 The classpath: /usr/local/jetty/lib/jetty-xml-7.0.1.v20091125.jar:/usr/local/jetty/lib/servlet-api-2.5.jar:/usr/local/jetty/lib/jetty-http-7.0.1.v20091125.jar:/usr/local/jetty/lib/jetty-continuation-7.0.1.v20091125.jar:/usr/local/jetty/lib/jetty-server-7.0.1.v20091125.jar:/usr/local/jetty/lib/jetty-security-7.0.1.v20091125.jar:/usr/local/jetty/lib/jetty-servlet-7.0.1.v20091125.jar:/usr/local/jetty/lib/jetty-webapp-7.0.1.v20091125.jar:/usr/local/jetty/lib/jetty-deploy-7.0.1.v20091125.jar:/usr/local/jetty/lib/jetty-servlets-7.0.1.v20091125.jar:/usr/local/jetty/lib/jsp/ant-1.6.5.jar:/usr/local/jetty/lib/jsp/core-3.1.1.jar:/usr/local/jetty/lib/jsp/jetty-jsp-2.1-7.0.1.v20091125.jar:/usr/local/jetty/lib/jsp/jsp-2.1-glassfish-9.1.1.B60.25.p2.jar:/usr/local/jetty/lib/jsp/jsp-api-2.1-glassfish-9.1.1.B60.25.p2.jar:/usr/local/jetty/resources:/usr/local/jetty/lib/jetty-util-7.0.1.v20091125.jar:/usr/local/jetty/lib/jetty-io-7.0.1.v20091125.jar Any help would be greatly appreciated. Thanks in advance, Lior.

    Read the article

  • Checking servlet session attribute value in jsp file

    - by Marta
    I have a no framework java application. It consists of jsp files for view and servlets for the business logic. I must set the user session is the servlet with a firstName parameter. In the jsp file, I need to check if my firstName parameter has a value or not. If the firstName parameter is set, I need to display some html in the jsp file. If it is not set, I need to display different html in the jsp file. Servlet.java: HttpSession session = request.getSession(); session.setAttribute("firstName", customer.getFristName()); String url = "/index.jsp"; RequestDispatcher dispatcher = getServletContext().getRequestDispatcher(url); dispatcher.forward(request, response); header.jsp: // Between the <p> tags bellow I need to put some HTML with the following rules // If firstName exist: Hello ${firstName} <a href="logout.jsp">Log out</a> // Else: <a href="login.jsp">Login</a> or <a href="register.jsp">Register</a> <p class="credentials" id="cr"></p> What would be the best way to do this? Any help is much appreciated! Thank you in advance. -Marta

    Read the article

  • When I mix JSTL 1.0 and JSTL 1.1 taglib declarations, it causes a ParseException on some of my serve

    - by sangfroid
    Hello all, When I mix JSTL 1.0 and JSTL 1.1 taglib declarations, it causes a ParseException on some of my servers, but not all of them. Here is the block of code that's giving me trouble : <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"%> <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%> <c:set var="TEXTVARIABLE">|STRINGOFTEXT|</c:set> <c:set var="OTHERTEXTVARIABLE">${fn:contains(TEXTVARIABLE, '|STRINGOFTEXT|')}</c:set> And here is the exception : javax.servlet.jsp.JspException: com.caucho.jsp.JspLineParseException: /WEB-INF/jsp/online/system/modules/com.MYCOMPANY.marketing/templates/common/MY_JSP_PAGE.jsp:1: tag = 'out' / attribute = 'value': An error occurred while parsing custom action attribute "value" with value "${fn:contains(TEXTVARIABLE, '|STRINGOFTEXT|')}": org.apache.taglibs.standard.lang.jstl.parser.ParseException: EL functions are not supported. However, everything works fine if I change the URI for the core declaration to http://java.sun.com/jsp/jstl/core So here's the really weird part : for some reason, mixing 1.0 and 1.1 taglib declarations only causes an exception on two of my servers -- my staging server and my production server. It causes no problems at all on my local machine or my development server. Why is this? What could possibly be causing this difference in behavior? The three servers are extremely similar in setup and configuration. The JSP page is being served up by OpenCMS, and I'm using the Caucho's Resin webserver. I understand that you don't know how my servers or CMS are set up, but really, what I'm looking for is ideas. Any ideas at all would help -- this problem has been driving me absolutely batty. Even if you don't know what could be causing the problem, if you have any suggestions at all for how I could approach the problem, that would be extremely helpful. I just don't understand what could cause this difference in behavior between my servers. For reference, here's the full stack trace : javax.servlet.jsp.JspException: com.caucho.jsp.JspLineParseException: /WEB-INF/jsp/online/system/modules/com.MYCOMPANY.marketing/templates/common/MY_JSP_PAGE.jsp:1: tag = 'out' / attribute = 'value': An error occurred while parsing custom action attribute "value" with value "${fn:contains(TEXTVARIABLE, '|STRINGOFTEXT|')}": org.apache.taglibs.standard.lang.jstl.parser.ParseException: EL functions are not supported. at org.opencms.jsp.CmsJspTagInclude.includeActionWithCache(CmsJspTagInclude.java:369) at org.opencms.jsp.CmsJspTagInclude.includeTagAction(CmsJspTagInclude.java:241) at org.opencms.jsp.CmsJspTagInclude.doEndTag(CmsJspTagInclude.java:472) at _jsp._WEB_22dINF._jsp._online._system._modules.com_MYCOMPANY__marketing._templates._MAIN_0PAGE__jsp._jspService(_MAIN_0PAGE__jsp.java:153) at com.caucho.jsp.JavaPage.service(JavaPage.java:60) at com.caucho.jsp.Page.pageservice(Page.java:579) at com.caucho.server.dispatch.PageFilterChain.doFilter(PageFilterChain.java:179) at shared.filter.RemoteAddrFilterBase.doFilter(RemoteAddrFilterBase.java:57) at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70) at com.caucho.server.webapp.DispatchFilterChain.doFilter(DispatchFilterChain.java:115) at com.caucho.server.cache.CacheFilterChain.doFilter(CacheFilterChain.java:175) at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:229) at com.caucho.server.webapp.RequestDispatcherImpl.include(RequestDispatcherImpl.java:485) at com.caucho.server.webapp.RequestDispatcherImpl.include(RequestDispatcherImpl.java:350) at org.opencms.flex.CmsFlexRequestDispatcher.includeExternal(CmsFlexRequestDispatcher.java:194) at org.opencms.flex.CmsFlexRequestDispatcher.include(CmsFlexRequestDispatcher.java:169) at org.opencms.loader.CmsJspLoader.service(CmsJspLoader.java:1193) at org.opencms.flex.CmsFlexRequestDispatcher.includeInternalWithCache(CmsFlexRequestDispatcher.java:423) at org.opencms.flex.CmsFlexRequestDispatcher.include(CmsFlexRequestDispatcher.java:173) at org.opencms.loader.CmsJspLoader.dispatchJsp(CmsJspLoader.java:1227) at org.opencms.loader.CmsJspLoader.load(CmsJspLoader.java:1171) at org.opencms.loader.A_CmsXmlDocumentLoader.load(A_CmsXmlDocumentLoader.java:232) at org.opencms.loader.CmsXmlContentLoader.load(CmsXmlContentLoader.java:52) at org.opencms.loader.CmsResourceManager.loadResource(CmsResourceManager.java:964) at org.opencms.main.OpenCmsCore.showResource(OpenCmsCore.java:1498) at org.opencms.main.OpenCmsServlet.doGet(OpenCmsServlet.java:152) at javax.servlet.http.HttpServlet.service(HttpServlet.java:115) at javax.servlet.http.HttpServlet.service(HttpServlet.java:92) at com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:106) at com.caucho.filters.CmsGzipFilter.doFilter(CmsGzipFilter.java:177) at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70) at shared.filter.RemoteAddrFilterBase.doFilter(RemoteAddrFilterBase.java:57) at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70) at com.caucho.server.webapp.DispatchFilterChain.doFilter(DispatchFilterChain.java:115) at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:229) at com.caucho.server.webapp.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:277) at com.caucho.server.webapp.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:106) at com.caucho.server.dispatch.ForwardFilterChain.doFilter(ForwardFilterChain.java:80) at com.caucho.server.cache.CacheFilterChain.doFilter(CacheFilterChain.java:207) at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:173) at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:229) at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:274) at com.caucho.server.port.TcpConnection.run(TcpConnection.java:514) at com.caucho.util.ThreadPool.runTasks(ThreadPool.java:520) at com.caucho.util.ThreadPool.run(ThreadPool.java:442) at java.lang.Thread.run(Thread.java:595) Caused by: com.caucho.jsp.JspLineParseException: /WEB-INF/jsp/online/system/modules/com.MYCOMPANY.marketing/templates/common/MY_JSP_PAGE.jsp:1: tag = 'out' / attribute = 'value': An error occurred while parsing custom action attribute "value" with value "${fn:contains(TEXTVARIABLE, '|STRINGOFTEXT|')}": org.apache.taglibs.standard.lang.jstl.parser.ParseException: EL functions are not supported. at com.caucho.jsp.java.JspNode.error(JspNode.java:1489) at com.caucho.jsp.java.JspNode.error(JspNode.java:1480) at com.caucho.jsp.java.JavaJspGenerator.validate(JavaJspGenerator.java:466) at com.caucho.jsp.JspCompilerInstance.generate(JspCompilerInstance.java:475) at com.caucho.jsp.JspCompilerInstance.compile(JspCompilerInstance.java:373) at com.caucho.jsp.JspManager.compile(JspManager.java:233) at com.caucho.jsp.JspManager.createPage(JspManager.java:177) at com.caucho.jsp.JspManager.createPage(JspManager.java:157) at com.caucho.jsp.PageManager.getPage(PageManager.java:248) at com.caucho.jsp.PageManager.getPage(PageManager.java:166) at com.caucho.jsp.QServlet.getSubPage(QServlet.java:292) at com.caucho.jsp.QServlet.getPage(QServlet.java:210) at com.caucho.server.dispatch.PageFilterChain.compilePage(PageFilterChain.java:206) at com.caucho.server.dispatch.PageFilterChain.doFilter(PageFilterChain.java:133) at shared.filter.RemoteAddrFilterBase.doFilter(RemoteAddrFilterBase.java:57) at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70) at com.caucho.server.webapp.DispatchFilterChain.doFilter(DispatchFilterChain.java:115) at com.caucho.server.cache.CacheFilterChain.doFilter(CacheFilterChain.java:175) at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:229) at com.caucho.server.webapp.RequestDispatcherImpl.include(RequestDispatcherImpl.java:485) at com.caucho.server.webapp.RequestDispatcherImpl.include(RequestDispatcherImpl.java:350) at org.opencms.flex.CmsFlexRequestDispatcher.includeExternal(CmsFlexRequestDispatcher.java:194) at org.opencms.flex.CmsFlexRequestDispatcher.include(CmsFlexRequestDispatcher.java:169) at org.opencms.loader.CmsJspLoader.service(CmsJspLoader.java:1193) at org.opencms.flex.CmsFlexRequestDispatcher.includeInternalWithCache(CmsFlexRequestDispatcher.java:423) at org.opencms.flex.CmsFlexRequestDispatcher.include(CmsFlexRequestDispatcher.java:173) at org.opencms.jsp.CmsJspTagInclude.includeActionWithCache(CmsJspTagInclude.java:364) ... 45 more Thanks for the help!

    Read the article

  • Hidden features of JSP/Servlet

    - by mkoryak
    I am interested in your tricks etc used when writing JSP/Servlet. I will start: I somewhat recently found out how you can include the output of one JSP tag in an attribute of another tag: <c:forEach items="${items}"> <jsp:attribute name="var"> <mytag:doesSomething/> </jsp:attribute> <jsp:body> <%-- when using jsp:attribute the body must be in this tag --%> </jsp:body> </c:forEach>

    Read the article

  • Can I pass data into a HashMap<String,Object> from JSP to a JavaBean?

    - by Parris
    Hi Everyone, I am just starting out with JSP, Java, etc web development... I would love to use some sort of framework, but for this project I can't do that. In any case I want to potentially pass essentially limitless data (for flexibility) to my javabeans. My idea was if I can have key value pairs that would really easy. The values will always be strings or integers. HashMap seems ideal in this case. Is this possible? Any ideas? Can I do this with JSP Bean tags or should I write scriptlets? Thanks!!!

    Read the article

  • How to develop JSP/Servlets Web App using MVC pattern?

    - by A.S al-shammari
    I'm developing a JSP/Servlets web app (no frameworks). I want to use MVC pattern. I designed my project like this : Controller :a servlet that reads a request, extracts the values,communicates with model objects and gives information to a JSP page. View : JSP Pages. Model : Java Classes / Java Beans .. etc . The problem : Index.jsp is the starting point (default page) in my web site. So, the Index.jsp becomes the controller to parse the request! .For example , the following request : index.jsp?section=article&id=10 parsed in index.jsp as following : <div class="midcol"> <!-- Which section? --> <%String fileName = request.getParameter("section"); if (fileName == null) { fileName = "WEB-INF/jspf/frontpage.jsp"; } else { fileName = "WEB-INF/jspf/" + fileName + ".jsp"; } %> <jsp:include page='<%= fileName%>' /> </div> Here, I can't force the servlet to be a controller .. because the index.jsp is the controller here since it's the starting point! Is there any solution to forward the request from index.jsp to the servlet and then go back to index.jsp ? Or any solution that achieves the MVC goal - the servlet should be the controller - ? I'm thinking of making a FrontPageController servlet as default page instead of index.jsp ! but I don't know if it's a perfect idea ?!

    Read the article

  • How to get dropdown value using jsp:useBean and jsp:setProperty?

    - by littlevahn
    I have a rather simple form in JSP that looks like this: <form action="response.jsp" method="POST"> <label>First Name:</label><input type="text" name="firstName" /><br> <label>Last Name:</label><input type="text" name="lastName" /><br> <label>Email:</label><input type="text" name="email" /><br> <label>Re-enter Email:</label><input type="text" name="emailRe" /><br> <label>Address:</label><input type="text" name="address" /><br> <label>Address 2:</label><input type="text" name="address2" /><br> <label>City:</label><input type="text" name="city" /><br> <label>Country:</label> <select name="country"> <option value="0">--Country--</option> <option value="1">United States</option> <option value="2">Canada</option> <option value="3">Mexico</option> </select><br> <label>Phone:</label><input type="text" name="phone" /><br> <label>Alt Phone:</label><input type="text" name="phoneAlt" /><br> <input type="submit" value="submit" /> </form> But when I try and access the value of the select box in my Java class I get null. Ive tried reading it in as a String and an Array of strings neither though seems to be grabbing the right value. The response.jsp looks like this: <%@ page language="java" %> <%@ page import="java.util.*" %> <%@page contentType="text/html" pageEncoding="UTF-8"%> <%! %> <jsp:useBean id="formHandler" class="validation.RegHandler" scope="request"> <jsp:setProperty name="formHandler" property="*" /> </jsp:useBean> <% if (formHandler.validate()) { %> <jsp:forward page="success.jsp"/> <% } else { %> <jsp:forward page="retryReg.jsp"/> <% } %> I already have Java script validation in place but I wanted to make sure I covered validation and checking for non-JS users. The RegHandler just uses the name field to refer to the value in the form. Any Idea how I could access the select box's value?

    Read the article

  • How to use bean in JSP?

    - by Nick
    How to use bean in JSP with only <jsp:useBean>, not MVC? Assume you have a grade.txt file which contains following data: Tom 90 Jerry 70 Katy 80 John 60 It asks you to create a bean named grade.java, a JSP page named graderesult.jsp, and a html page named gradecheck.html. gradecheck.html provides a input textbox and a button submit, once you submit the name of the student, the graderesult.jsp will communicates with bean to show the name and the score corresponding to the person.

    Read the article

  • JSP to Bean to Java class Validation

    - by littlevahn
    I have a rather simple form in JSP that looks like this: <form action="response.jsp" method="POST"> <label>First Name:</label><input type="text" name="firstName" /><br> <label>Last Name:</label><input type="text" name="lastName" /><br> <label>Email:</label><input type="text" name="email" /><br> <label>Re-enter Email:</label><input type="text" name="emailRe" /><br> <label>Address:</label><input type="text" name="address" /><br> <label>Address 2:</label><input type="text" name="address2" /><br> <label>City:</label><input type="text" name="city" /><br> <label>Country:</label> <select name="country"> <option value="0">--Country--</option> <option value="1">United States</option> <option value="2">Canada</option> <option value="3">Mexico</option> </select><br> <label>Phone:</label><input type="text" name="phone" /><br> <label>Alt Phone:</label><input type="text" name="phoneAlt" /><br> <input type="submit" value="submit" /> </form> But when I try and access the value of the select box in my Java class I get null. Ive tried reading it in as a String and an Array of strings neither though seems to be grabbing the right value. The response.jsp looks like this: <%@ page language="java" %> <%@ page import="java.util.*" %> <%@page contentType="text/html" pageEncoding="UTF-8"%> <%! %> <jsp:useBean id="formHandler" class="validation.RegHandler" scope="request"> <jsp:setProperty name="formHandler" property="*" /> </jsp:useBean> <% if (formHandler.validate()) { %> <jsp:forward page="success.jsp"/> <% } else { %> <jsp:forward page="retryReg.jsp"/> <% } %> I already have Java script validation in place but I wanted to make sure I covered validation and checking for non-JS users. The RegHandler just uses the name field to refer to the value in the form. Any Idea how I could access the select box's value?

    Read the article

  • sitemesh vs jsp-config (<include-prelude>)

    - by Nrj
    Please help clarifying : In web.xml I have the following <jsp-config> <jsp-property-group> <url-pattern>*.jsp</url-pattern> <el-ignored>false</el-ignored> <page-encoding>utf-8</page-encoding> <include-prelude>/jstlTaglibs.jspf</include-prelude> </jsp-property-group> </jsp-config> Also in decorators.xml I have <decorator name="footer" page="footer.jsp"> <pattern>*.action</pattern> </decorator> which is used via sitemesh.xml. The footer.jsp which says ... <decorator:body /> <@include .. "footer.jsp"/> So what I gather is, both of the codes above in a sense inject some jspf. Please help highlighting the differences and benefits of both the approaches. Also which one is more used across industry ?

    Read the article

  • JSP request parameter is returning null on a jsp include with Weblogic.

    - by doug
    Hello, I am having trouble with the jsp:include tag. I have code like the following: <jsp:include page="./Address.jsp"> <jsp:param value="30" name="tabIndex"/> <jsp:param value="true" name="showBox"/> <jsp:param value="none" name="display"/> </jsp:include> The page is included fine, but when I try to access the parameters on the Address.jsp page, they are null. I have tried accessing them the following ways (with jstl): <c:out value="${param.tabIndex}" /> <c:out value="${param['tabIndex']} /> <%= request.getParameter("tabIndex") %> <c:out value="${pageScope.param.tabIndex} /> ${param.tabIndex} etc... Here is the kicker, The above works fine in tomcat 5.5. However, when I deploy the application in Weblogic 10, it does not. Also, the code works fine in other areas of my application (on weblogic) just not a particular page. Any Ideas? Thanks!

    Read the article

  • JSP request parameter is returning null on a jsp include win Weblogic.

    - by doug
    Hello, I am having trouble with the jsp:include tag. I have code like the following: <jsp:include page="./Address.jsp"> <jsp:param value="30" name="tabIndex"/> <jsp:param value="true" name="showBox"/> <jsp:param value="none" name="display"/> </jsp:include> The page is included fine, but when I try to access the parameters on the Address.jsp page, they are null. I have tried accessing them the following ways (with jstl): <c:out value="${param.tabIndex}" /> <c:out value="${param['tabIndex']} /> <%= request.getParameter("tabIndex") %> <c:out value="${pageScope.param.tabIndex} /> ${param.tabIndex} etc... Here is the kicker, The above works fine in tomcat 5.5. However, when I deploy the application in Weblogic 10, it does not. Also, the code works fine in other areas of my application (on weblogic) just not a particular page. Any Ideas? Thanks!

    Read the article

  • Tomcat does not pick up the class file - the JSP file is not displayed

    - by blueSky
    I have a Java code which is a controller for a jsp page, called: HomeController.java. Code is as follows: @Controller public class HomeController { protected final transient Log log = LogFactory.getLog(getClass()); @RequestMapping(value = "/mypage") public String home() { System.out.println("HomeController: Passing through..."); return "home"; } } There is nothing especial in the jsp page: home.jsp. If I go to this url: http://localhost:8080/adcopyqueue/mypage I can view mypage and everything works fine. Also in the tomcat Dos page I can see the comment: HomeController: Passing through... As expected. Now under the same directory that I have HomeController.java, I've created another file called: LoginController.java. Following is the code: @Controller public class LoginController { protected final transient Log log = LogFactory.getLog(getClass()); @RequestMapping(value = "/loginpage") public String login() { System.out.println("LoginController: Passing through..."); return "login"; } } And under the same place which I have home.jsp, I've created login.jsp. Also under tomcat folders, LoginController.class exists under the same folder that HomeController.class exists and login.jsp exists under the same folder which home.jsp exists. But when I go to this url: http://localhost:8080/adcopyqueue/loginpage Nothing is displayed! I think tomcat does not pick up LoginController.class b/c on the tomcat Dos window, I do NOT see this comment: LoginController: Passing through... Instead I see following which I do not know what do they mean? [ INFO] [http-8080-1 01:43:45] (AppInfo.java:populateAppInfo:34) got manifest [ INFO] [http-8080-1 01:43:45] (AppInfo.java:populateAppInfo:36) manifest entrie s 8 The structure and the code for HomeController.java and LoginController.java plus the jsp files match. I have no idea why tomcat sees one of the files and not the other? Clean build did not help. Does anybody have any idea? Any help is greatly appraciated.

    Read the article

  • JSP displaying source code instead of executing

    - by DJStroky
    I'm new to jsp and have ran into some trouble. Initially, the jsp file and associated java classes were built and tested fine on a test Tomcat server. Now, they've been transitioned to another server of what I believe is the same setup (except it's linux now instead of windows). But when the jsp page is accessed the source code is displayed instead of the jsp actually executing. I've googled for a while but received no success. I had thought that this page might solve the problem since there was no reference to the jsp file I was using or even the following snippets in my web.xml file in the WEB-INF folder: <servlet> <servlet-name>jsp</servlet-name> <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class> <init-param> <param-name>logVerbosityLevel</param-name> <param-value>WARNING</param-value> </init-param> <load-on-startup>3</load-on-startup> </servlet> <servlet-mapping> <servlet-name>jsp</servlet-name> <url-pattern>*.jsp</url-pattern> </servlet-mapping> I tried inserting these lines and restarting Tomcat, but no success. Any ideas?

    Read the article

  • How to prevent client from accessing JSP page

    - by Ali Bassam
    In my web application, I use the .load() function in JQuery, to load some JSP pages inside a DIV. $("#myDiv").load("chat.jsp"); In chat.jsp, no Java codes is executed unless this client has Logged in, means, I check the session. String sessionId = session.getAttribute("SessionId"); if(sessionId.equals("100")){ //execute codes }else{ //redirect to log in page } Those java codes that will be executed, they will out.println(); some HTML elements. I don't want the client to write /chat.jsp in the browser to access this page, as it will look bad, and the other stuff in the main page won't be there, and this could do a harm to the web app security. How can I restrict someone from accessing chat.jsp directly, but yet keep it accessible via .load() ? UPDATE: JavaDB is a class that I made, it connects me to the Database. This is chat.jsp <body> <% String userId = session.getAttribute("SessionId").toString(); if (userId != null) { String roomId = request.getParameter("roomId"); String lastMessageId = request.getParameter("lastMessageId"); JavaDB myJavaDB = new JavaDB(); myJavaDB.Connect("Chat", "chat", "chat"); Connection conn = myJavaDB.getMyConnection(); Statement stmt = conn.createStatement(); String lastId = ""; int fi = 0; ResultSet rset = stmt.executeQuery("select message,message_id,first_name,last_name from users u,messages m where u.user_id=m.user_id and m.message_id>" + lastMessageId + " and room_id=" + roomId + " order by m.message_id asc"); while (rset.next()) { fi = 1; lastId = rset.getString(2); %> <div class="message"> <div class="messageSender"> <%=rset.getString(3) + " " + rset.getString(4)%> </div> <div class="messageContents"> <%=rset.getString(1)%> </div> </div> <% } %> <div class="lastId"> <% if (fi == 1) {%> <%=lastId%> <% } else {%> <%=lastMessageId%> <% }%></div> <% if (fi == 1) {%> <div class="messages"> </div> <% } } else { response.sendRedirect("index.jsp"); }%> </body> Guys I don't know what Filter means. UPDATE If I decided to send a parameter that tells me that this request came from Jquery. .load("chat.jsp",{ jquery : "yes" }); And then check it in chat.jsp String yesOrNo = request.getParameter("jquery"); Then they can simply hack this by using this URL. /chat.jsp?jquer=yes or something like that.. UPDATE I tried Maksim's advice, I got this when I tried to access chat.jsp. Is this the desired effect?

    Read the article

  • Phishing attack stuck with jsp loginAction.do page? [closed]

    - by user970533
    I 'm testing a phishing website on a staged replica of an jsp web-application. I'm doing the usual attack which involves changing the post and action field of source code to divert to my own written jsp script capture the logins and redirect the victim to the original website. It looks easy but trust me its has been me more then 2 weeks I cannot write the logins to the text file. I have tested the jsp page on my local wamp server it works fine. In staged when I click on the ok button for user/password field I'm taken to loginAction.do script. I checked this using tamper data add on on firefox. The only way I was able to make my script run was to use burp proxy intercept the request and change action parameter to refer my uploaded script. I want to know what does an loginAction.do? I have googled it - its quite common to see it in jsp application. I have checked the code; there is nothing that tells me why the page always point to the .do script instead of mine. Is there some kind of redirection in tomcat configuration. I like to know. I'm unable to exploit this attack vector? I need the community help

    Read the article

  • Spring MVC JSP Parameters

    - by zpinter
    I'm looking to turn off try blocks for a specific JSP page (though turning it off globally would be OK as well). From what I've gathered, it looks something like this: <jsp-param> <param-name>noTryBlocks</param-name> <param-value>true</param-value> </jsp-param> However, everywhere I see that sample it's for a weblogic.xml file. Does anybody know how I can set this JSP parameters for a Spring MVC application? web.xml? Perhaps somewhere near here?: <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/> <property name="prefix" value="/WEB-INF/jsp/"/> <property name="suffix" value=".jsp"/> </bean>

    Read the article

  • pass parameter from javascript to another jsp

    - by gautam
    I want to pass parameter from a Javascript function to another JSP page. Currently I am doing like this: function viewapplet(strPerfMonPoint) { var dateSelected = document.forms[0].hdnDateSelected.value; document.forms[0].hdnPerfMonPoint.value = strPerfMonPoint; var win; win = window.open("jsp/PopUp.jsp?GraphPerfMon="+strPerfMonPoint+"&strDateSelected="+dateSelected, strPerfMonPoint,"width=800,height=625,top=40,left=60 resizable=No"); } I added hdnPerfMonPoint hidden variable and tried to acces in PopUp.jsp using request.getparameter(hdnPerfMonPoint) but it is giving null. I want my window.open like: window.open("jsp/PopUp.jsp", strPerfMonPoint,"width=800,height=625,top=40,left=60 resizable=No"); Please suggest solution.

    Read the article

  • JSP Component Creation

    - by jboyd
    When creating JSP pages one thing that I'd often like is the ability to do something like this: <jsp:include page="fancystoryrenderer.jsp" value="${aStoryObjectInMyModel}/> ... fancystoryrenderer.jsp <div id="fancymainbody"> ... ${theStory.title} ... </div> The main important characteristics of this is that I can reuse the same component on the same JSP page in different places without having to copy paste the component and give the story variables different names, notice that the story is called "theStory" in the JSP and not "aStoryObjectInMyModel", the linkage between our model has been broken by the view, which is a good thing in this case How do you do this?

    Read the article

  • Which variables can be accessed with the ${...} syntax in a Struts tag in a JSP page?

    - by Bernhard V
    Hi, I'm getting a little bit frustrated since I can't find out which variables I can access with the ${...} syntax in a Struts tag, placed in a JSP page. As an example I've got the following code: Where does the object "status.menueStatus" have to be defined in order to can be accessed with a dollar sign and braces. Is it defined in another struts tile or in the form? Whether within our project code nor by Google I can get any help. Your support would be very appreciated. Thank you. Bernhard

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >