Embedded Legend in JSP file

I would like to embed my legend within my map request. I can display the legend on my page within a Table Row, but I would prefer it located inthe Southwest corner of my map image. Can this be done? I have seen it in XML done this way.
Here is my legend code as well as my map display code.
Thanks!
<tr><td><mv:makeLegend id="myLegend">
<legend bgstyle="fill:#ffffff;stroke:#ff0000" profile="SMALL" position="SOUTHWEST">
<column>
<entry text="Map Legend:" is_title="true" />
<entry style="M.GREEN" text="No Outages Reported" />
<entry style="M.RED" text="Outage Reported" />
<entry style="M.AMBER" text="Degraded Status Reported" />
</column>
</legend>
</mv:makeLegend>
<IMG SRC="<%=myLegend%>"></td></tr>
<tr align="center">
<td valign="top" align="center">
<input type="image"
border="1"
src="<mv:getMapURL />"
name="userClick"
alt="Click on the map for selected action">
</td></tr>

Hi,
you can't use the makeLegend tag to embed it on map, but you can add an API method on your jsp code to add the legend. This is an example:
<%@ taglib uri="http://xmlns.oracle.com/j2ee/jsp/tld/spatial/mvtaglib.tld" prefix="mapviewer"%>
<%@ page contentType="text/html;charset=windows-1252"%>
<%@ page import="oracle.lbs.mapclient.MapViewer" %>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>untitled</title>
  </head>
  <body title="MapViewer WebMap">
    <DIV align="center">
      <mapviewer:init url="http://stadb35.us.oracle.com:8888/mapviewer/omserver" datasource="mvdemo" id="mvHandle"/>
      <mapviewer:setParam basemap="density_map" width="600" height="450" antialiasing="true" title="My Web Map" centerX="-122.4" centerY="37.8" size="10"/>
    <%
      MapViewer mv = (MapViewer) session.getAttribute("mvHandle");
      mv.setMapLegend("<legend bgstyle=\"fill:#ffffff;stroke:#ff0000\" " +
                      "profile=\"MEDIUM\" position=\"SOUTHWEST\">\n" +
                      "<column>\n" +
                      "<entry text=\"Map Legend:\" is_title=\"true\" />\n " +
                      "<entry style=\"V.COUNTY_POP_DENSITY\" tab=\"1\"/>\n " +
                      "</column>\n " +
                      "</legend>");
    %>
      <mapviewer:run/>
    </DIV>
    <img src="<mapviewer:getMapURL />"/>
  </body>
</html>

Similar Messages

  • Embedding logo in a JSP file created by JDev2

    I am using HTML code(as usual) in a JSP file to create a e-Commerce site. I want to show company logo which is a .jpg file and also the company name in a single frame. Can someone please tell me how I embed logo and text in this single frame?
    Suntae

    I chose from the drop-down list.
    Maybe not.
    Anyway, thank you very much!

  • Exception while opening a JSP file

    HI,
    I have created a JSP page which contains embedded Oracle reports build using Oracle Report Builder.
    I have deployed the JSP created above to the Oracle Application Server
    but when i try to open the JSP file it gives the following error:
    500 Internal Server Error
    javax.servlet.jsp.JspException: rwlib-1: REP-1202: ORACLE logon not specified.     at oracle.reports.jsp.ObjectsTag.doEndTag(ObjectsTag.java:206)     at testing.test1._jspService(_test1.java:75)     [SRC:/testing/test1.jsp:0]     at com.orionserver[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)     at oracle.jsp.runtimev2.JspPageTable.compileAndServe(JspPageTable.java:567)     at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:302)     at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509)     at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413)     at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)     at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)     at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source)     at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:604)     at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)     at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790)     at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.AJPRequestHandler.run(AJPRequestHandler.java:208)     at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.AJPRequestHandler.run(AJPRequestHandler.java:125)     at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)     at java.lang.Thread.run(Thread.java:534)
    can anybody help regarding this
    this is of high priority to me
    thanks and regards
    Subhajit

    bump

  • Exception while opening a JSP file created using oracle report builder

    I have created a JSP page which contains embedded Oracle reports build using Oracle Report Builder.
    I have deployed the JSP created above to the Oracle Application Server
    but when i try to open the JSP file it gives the following error:
    500 Internal Server Error
    javax.servlet.jsp.JspException: rwlib-1: REP-1202: ORACLE logon not specified. at oracle.reports.jsp.ObjectsTag.doEndTag(ObjectsTag.java:206) at testing.test1._jspService(_test1.java:75) [SRC:/testing/test1.jsp:0] at com.orionserver[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].http.OrionHttpJspPage.service(OrionHttpJspPage.java:56) at oracle.jsp.runtimev2.JspPageTable.compileAndServe(JspPageTable.java:567) at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:302) at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509) at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65) at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source) at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:604) at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317) at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790) at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.AJPRequestHandler.run(AJPRequestHandler.java:208) at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.AJPRequestHandler.run(AJPRequestHandler.java:125) at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192) at java.lang.Thread.run(Thread.java:534)
    can anybody help regarding this
    this is of high priority to me
    thanks and regards
    Subhajit

    bump

  • Is it possible to get control of the .SWF files in JSP files

    Hi All
    In my web application, I got 4 swf buttons which are created by flash and they are embedded in the jsp's. Each button perform the navigation to other page.
    this is the jsp file.
         <table width="100%" border="0">
                  <tr>
                    <td width="2%" height="26"> </td>
                    <td width="31%"> <object classid="clsid:...." codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="100" height="22">
                        <param name="BASE" value=".">
                        <param name="BGCOLOR" value="">
                        <param name="movie" value="button1.swf">
                        <param name="quality" value="high">
                        <embed src="button1.swf" width="100" height="22" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" base="." ></embed>
                      </object> <font size="-1" face="Arial, Helvetica, sans-serif"> </font></td>
                    <td width="67%" class="sitemapgy">*Add*  </td>
                  </tr>
                  <tr>
                    <td height="26"> </td>
                    <td><object classid="clsid:..." codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="100" height="22">
                        <param name="BASE" value=".">
                        <param name="BGCOLOR" value="">
                        <param name="movie" value="button2.swf">
                        <param name="quality" value="high">
                        <embed src="button2.swf" width="100" height="22" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" base="." ></embed>
                      </object> </td>
                    <td class="sitemapgy">*Edit* ;</td>
                  </tr>
                  <tr>
                    <td height="26"> </td>
                    <td><object classid="clsid:..." codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="100" height="22">
                        <param name="movie" value="button13.swf">
                        <param name="quality" value="high">
                        <param name="base" value=".">
                        <embed src="button7.swf" base="."  quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="100" height="22" ></embed>
                      </object></td>
                    <td class="sitemapgy">*Create*</td>
                  </tr>
                  <tr>
                    <td height="26"> </td>
                    <td><object classid="clsid:.." codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="100" height="22">
                        <param name="BGCOLOR" value="">
                        <param name="movie" value="main_print.swf">
                        <param name="quality" value="high">
                        <param name="base" value=".">
                        <embed src="main_print.swf" base="."  quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="100" height="22" ></embed>
                      </object></td>
                    <td class="sitemapgy"><font face="Arial, Helvetica, sans-serif">*Print*</font></td>
                  </tr>
                  <tr>
                    <td height="26"> </td>
                    <td><object classid="clsid:..." codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="100" height="22" >
                        <param name="BGCOLOR" value="">
                        <param name="BASE" value=".">
                        <param name="movie" value="button3.swf">
                        <param name="quality" value="high">
                        <embed src="button3.swf" width="100" height="22" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" base="." ></embed>
                      </object></td>
                    <td class="sitemapgy"><font face="Arial, Helvetica, sans-serif">*_Admin_*</font></td>
                  </tr>
                  <tr>
                    <td height="24"> </td>
                    <td> </td>
                    <td> </td>
                  </tr>
                </table>When I click the button3.swf (Admin) button....it navigates to other page...Before that I need to get control of swf button and need to perform some login checks.
    Is it possible to get control?
    Thanks

    Thanks for your responses, I tried in the same way but when ever it looking at the path "/admin/admin_main.jsp",
    its navigating to error page if the username is admin too(abcd).
    Can you please help me regarding this.
    I am sending you my code and web.xml.
                     <filter>
              <filter-name>ExampleFilter</filter-name>
              <filter-class>com.pack.db.ExampleFilter</filter-class>
         </filter>
                   <filter-mapping>
              <filter-name>ExampleFilter</filter-name>
              <url-pattern>/admin/admin_main.jsp</url-pattern>
         </filter-mapping>
    import java.io.*;
    import javax.servlet.Filter;
    import javax.servlet.FilterChain;
    import javax.servlet.FilterConfig;
    import javax.servlet.ServletException;
    import javax.servlet.ServletRequest;
    import javax.servlet.ServletResponse;
    import javax.servlet.RequestDispatcher;
    import javax.servlet.http.*;
    public class ExampleFilter implements Filter {
         private FilterConfig filterConfig=null;
         public void init(FilterConfig config) throws ServletException {
              this.filterConfig = config;
         public void destroy() {
              filterConfig = null;
         public void doFilter(ServletRequest request, ServletResponse response,
                   FilterChain chain) throws IOException, ServletException {
              RequestDispatcher rd = null;
              String userInfo = "";
              String userName="";
              if (request instanceof HttpServletRequest) {
                   userInfo = ((HttpServletRequest) request).getUserPrincipal()
                                      .getName();
                             String[] pieces = userInfo.split("\\\\"); // Firefox sends DOMAIN\USERNAME as UserPrincipal
                                  userName = pieces[pieces.length -1]; // getting the username for which I need to perform check
                                  if(userName!="abcd"){
                                  System.out.println("userName IN ELSE PART:"+userName);
                                  System.out.println("INVALID USER NAME");
                                 rd = request.getRequestDispatcher("/admin/error.html");// i need to forward the response url to error page if the username is not equal to "abcd"
                                 rd.forward(request, response);
                             else{
                             chain.doFilter(request, response); // if username="abcd" I need to navigate to normal pages.
    Thanks

  • Why this does not works??? (I use jsp: include. to contain two jsp files)

    I have a main.jsp, and in this main.jsp, I have two part, leftButton.jsp and view.jsp, I want to include the leftButton.jsp and view.jsp to main.jsp.
    The code of main.jsp is like follows:
    <%@ page language="java" contentType="text/html" %>
    <html>
    <head>
    <title>JSP include element test</title>
    </head>
    <body>
    <table>
    <tr>
    <td><jsp: include page="leftButton.jsp" flush="true"></jsp: include></td>
                             <td>     <jsp: include page="view.jsp" flush="true"></jsp: include></td>
                        </tr>
         </table>
    </body>
    </html>
    Why the include does not works? by the way, I embeded a flash.swf file in view.jsp.

    Hi Mellon,
    You might be better off using a JSPF segment for leftButton.jsp & view.jsp and the <%@ include file="relativeURL" %>.
    Be careful that the included file does not contain <html>, </html>, <body>, or </body> tags. Because the entire content of the included file is added to the including JSP page, these tags would conflict with the same tags in the including JSP page, causing an error.
    Note: It is conventional to put JSP segements under the WEB-INF/jspf/ folder so the file cannot be accessed directly by a URL
    Note: JSPF files end with .jspf, so your files would be leftButton.jspf and view.jspf.

  • Include directive to include a JSP file from a JAR file

    I have an Eclipse project in which I have placed a JSP file in the package structure with the rest of my code. This is in fact only a code snippet page, not a full blown JSP file.
    I have a second project that is a Dynamic Web Project in Eclipse that incorporates the first project as a JAR in the /WEB-INF/lib directory.
    In this project I have a JSP file and I want to include the JSP file embedded in that JAR file.
    How do I do that?
    I'm thinking the only real solution is to rewrite the snippet portion as a custom tag.

    The JSP fragment page in question is actually a HTML form page. It is a form to be used specifically by a particular servlet. That is why they are "bundled" together in the same project, in the same package structure.
    I have multiple web applications that I want to include that form/servlet, so it gets added to these projects in the /WEB-INF/lib folder as a JAR library. But I don't want to recreate the form over and over again for each application. It would be nice if I could write a JSP page that wraps the fragment using an include directive to bring that fragment into the new page.
    So to do that with any other fragment I would write:
    <%@ include file="/WEB-INF/jsp/SOME_FORM.jsp" %>
    which works great if my fragment page is in the /WEB-INF/jsp subfolder. But if I want to access the JSP fragment as it is bundled in a JAR file, this:
    <%@ include file="/WEB-INF/lib/FORM.jar/SOME_FORM.jsp" %>
    doesn't work so good. It's just all wrong.
    I was wondering how I could just write one include statement to get what I need. There are work-arounds galore, but I thought if I could get this working it would be the simplest solution overall.

  • Exception-Error when excecuting JSP-File in Crystal reports for Eclipse

    Hi,
    I have created a jsp-File from an rpt-File in Crystal report for Eclipse. When I start the jsp-File on Apache Tomact 5.5 then only errors occurs.
    Coud anyone help me?
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: Unable to compile class for JSP:
    An error occurred at line: 6 in the generated java file
    Only a type can be imported. com.crystaldecisions.report.web.viewer.CrystalReportViewer resolves to a package
    An error occurred at line: 7 in the generated java file
    Only a type can be imported. com.crystaldecisions.reports.sdk.ReportClientDocument resolves to a package
    An error occurred at line: 8 in the generated java file
    Only a type can be imported. com.crystaldecisions.sdk.occa.report.application.OpenReportOptions resolves to a package
    An error occurred at line: 9 in the generated java file
    Only a type can be imported. com.crystaldecisions.sdk.occa.report.lib.ReportSDKExceptionBase resolves to a package
    An error occurred at line: 10 in the generated java file
    Only a type can be imported. com.crystaldecisions.sdk.occa.report.reportsource.IReportSource resolves to a package
    An error occurred at line: 13 in the jsp file: /Bericht1-viewer.jsp
    ReportClientDocument cannot be resolved to a type
    10:      try catch (ReportSDKExceptionBase e)
    60:      
    An error occurred at line: 58 in the jsp file: /Bericht1-viewer.jsp
    e cannot be resolved
    55:
    56:
    57:      } catch (ReportSDKExceptionBase e)
    60:      
    61: %>
    Stacktrace:
         org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:93)
         org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
         org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:435)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:298)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:277)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:265)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:302)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.5.26 logs.
    Apache Tomcat/5.5.26
    Bericht1.jsp:
    <%@page import="com.crystaldecisions.report.web.viewer.CrystalReportViewer,
    com.crystaldecisions.reports.sdk.ReportClientDocument,
    com.crystaldecisions.sdk.occa.report.application.OpenReportOptions,
    com.crystaldecisions.sdk.occa.report.lib.ReportSDKExceptionBase,
    com.crystaldecisions.sdk.occa.report.reportsource.IReportSource"%><%
         // This sample code calls methods from the JRCHelperSample class, which
         // contains examples of how to use the BusinessObjects APIs. You are free to
         // modify and distribute the source code contained in the JRCHelperSample class.
         try {
              String reportName = "Bericht1.rpt";
              ReportClientDocument clientDoc = (ReportClientDocument) session.getAttribute(reportName);
              if (clientDoc == null) {
                   // Report can be opened from the relative location specified in the CRConfig.xml, or the report location
                   // tag can be removed to open the reports as Java resources or using an absolute path
                   // (absolute path not recommended for Web applications).
                   clientDoc = new ReportClientDocument();
                   // Open report
                   clientDoc.open(reportName, OpenReportOptions._openAsReadOnly);
                   // Store the report document in session
                   session.setAttribute(reportName, clientDoc);
                   // ****** BEGIN CONNECT CRYSTALREPORTPAGEVIEWER SNIPPET **************** 
                        // Create the CrystalReportViewer object
                        CrystalReportViewer crystalReportPageViewer = new CrystalReportViewer();
                        //     set the reportsource property of the viewer
                        IReportSource reportSource = clientDoc.getReportSource();                    
                        crystalReportPageViewer.setReportSource(reportSource);
                        // set viewer attributes
                        crystalReportPageViewer.setOwnPage(true);
                        crystalReportPageViewer.setOwnForm(true);
                        // Apply the viewer preference attributes
                        // Process the report
                        crystalReportPageViewer.processHttpRequest(request, response, application, null);
                   // ****** END CONNECT CRYSTALREPORTPAGEVIEWER SNIPPET ****************          
         } catch (ReportSDKExceptionBase e) {
             out.println(e);
    %>
    Thanks
    Arnold

    According to the release notes, for the JRCHelperSample to compile, you must set the target runtime for the project.
    To do this, either create a project from scratch that uses the Tomcat 5.5 target runtime, or go to the properties menu and ensure that the target runtime is set to the application server you will be using.

  • Import statement in .java files and .jsp files

    Guys I have few mysteries about this import statement.
    Please correct me if I am wrong.
    1)Suppose if I have a folder c:\SourceFolder it has one.java and two.java files.If I compile one.java then one.class files is created in c:\ClassFolder .Now two.java uses one of the method of one.java,and without using import statement I am able to compile two.java, and two.class file is created in c:\ClassFolder.I assume that the path of one.class was taken from the CLASSPATH environment variable,hence I there was no need for import statement .........am i right ?
    BUT... in My.jsp,which is in C:\JspFolder, if I want to use one.class,then I have to specifically import the class I want to use.That is i have to say
    <%@page import="one"%>
    and since the classpath is C:\ClassFolder ,it finds one.class in the C:\ClassFolder.(Note that My.class is created in a folder different from c:\ClassFolder )
    But I am wondering why was there no need for me to import one.class in two.java.
    (Note I am using JDeveloper and Apache server)
    Please help.
    In this case the pSo I am wondering in JSP why it doesn't take the class I am looking for from the classpath .
    Help.

    You have to understand Java scoping rules. In the 1st scenario with the two Java files I am guessing neither one of them begins with a package statement. This means that they belong to the default package. When you compile the compiler uses the classpath to resolve method calls looking in the default package since there was no import statement specified in two.java. JSP is a little different. Now I just read this here in these forums a couple of days ago. Since the classfiles generated from the JSP files are not in the CLASSPATH they are loaded by a different classloader. This is why you have to import all references to all classes in the default package.

  • Java class bean can not access to DB in JSP file

    Hi, I wrote a java class bean in order to access to MySql database ,and this bean is used in a JSP file,so that the bean can query from DB and then display the queried information on the JSP file,but it can not work correctly,the following is the source code and error message popup by the system,
    does anybody has experience in solving thus question,Please reply ,Thank you for your help.
    %@ page contentType="text/html;charset=UTF-8" language="java" %>
    <%@ page import = "java.sql.*" %>
    <jsp:useBean id="conn" scope="page" class="news.conn"/>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>1</title>
    <style>
    <!--
    A:link {
         COLOR: #993399
    .s {
         FONT-SIZE: 13px; LINE-HEIGHT: 170%; FONT-FAMILY: "utf-8"
    -->
    </style>
    </head>
    <body>
    <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1">
    <tr>
    <td width="100%">
    <img border="0" src="images/ruanjian.jpg" width="770" height="154"></td>
    </tr>
    <tr>
    <td width="100%">@</td>
    </tr>
    </table>
    <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber2">
    <tr>
    <td width="13%">@</td>
    <td width="87%">
    <img border="0" src="images/mid-rdxw2.gif" width="101" height="18"><p>
    <%
              ResultSet rs,rsNest;
    String strSql=null;
    strSql = "select * from news where TYPE=1";     
              rs = conn.executeQuery(strSql);
              while (rs.next()){
    %>
    <span class="s"> <a href="newsContent.jsp?newsId=<%=rs.getInt(id")%">"><%=rs.getString("Title")%></a><br>
    <%
    %>
    <p>
    <img border="0" src="images/mid-hyxw2.gif" width="94" height="19"></p>
    <%
    strSql="select * from news where TYPE=2";     
              rs = conn.executeQuery(strSql);
              while (rs.next()){
    %>
    <span class="s"> <a href="newsContent.jsp?newsId=<%=rs.getInt("id")%>"><%=rs.getString("Title")%></a><br>
    <%
    %>
    <p>@</td>
    </tr>
    </table>
    <p align="center">Study Online</p>
    <p align="center">@</p>
    </body>
    </html>
    Error message:
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: Exception in JSP: /newsMain.jsp:47
    44: strSql = "select * from news where TYPE=1";     
    45:           rs = conn.executeQuery(strSql);
    46:           
    47:           while (rs.next()){
    48:
    49: %>
    50:
    Stacktrace:
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:451)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    root cause
    java.lang.NullPointerException
         org.apache.jsp.newsMain_jsp._jspService(newsMain_jsp.java:98)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.5.27 l</a>

    nogoodatcoding wrote:
    Tolls wrote:
    Is that Jasper Exception telling us where the problem is in the jsp, though?
    If it is, then "rs" is null in the call rs.next()...which means conn.executeQuery() is returning null. Which means that whatever class conn is (news.conn?) has a problem maybe?That's possible. Though, it may just be the case that the 'conn' object itself is null! That line is the first place where it's being used and there are no checks that I can see...we'll have to wait for the OP to investigate and reply I guess.That's what I originally thought, then I noticed it was saying line 47, which is the rs.next() line. Assuming Jasper is correct in its choice of line, then it's the rs that's null. Which means the conn is doing strange things.
    Edit: Now that I think about it, going by the previous thread the OP posted, I'm wondering whether news.conn class is their attempt to move the JDBC stuff out of the JSP page, and it's grabbing the "real" connection (java.sql.Connection) and getting the result set and returning it...or getting something wrong and returning null.
    Edited by: Tolls on 11-Jun-2009 12:24

  • Relative Path for JSP Files

    I use Liferay Portal. It has a defined directory structure for all portlets and expects files to be in their proper locations. One of these is that it expects all .jsp files to be in the /webroot/html directory.
    The problem is that all references in the struts-config.xml to .jsp files are assumed to be relative to the /html directory. So if, for instance, I set the path as /test/test.jsp then Liferay looks for the file in /html/test/test.jsp. But NitroX requires the full path, including the /html.
    I've gotten this to work on another competing product - in that product I set the Web Root to be the /html directory and it works great. That product allows you to set the path of the struts-config.xml separately. Is there any way to do something similar with NitroX? I tried changing the webroot in the .m7project file manually but it doesn't like it. It seems to insist that the struts-config.xml file is in the webroot.
    Thanks.

    NitroX currently supports only a war directory structure. When a project is created, the Web Application Root directory is computed as the directory containing the WEB-INF folder (which should contain the web.xml file).
    All web app resources (JSP files, image, css files, etc) are expected to be under the Web Application Root directory (at any nested directory level).
    We will enhance this behavior in the future to support arbitrary directory structures.

  • Need help in using SQL in a jsp file to compare date and time

    hi every one,
    Actually I am doing a project using JSP. I need to compare a date field in the database (MS Acess) to the current system date and time. I have to do this in a select statement.
    I have alredy defined a variable of type Date in the JSP file and I am comparing this variable to the date in the database through a select statemant.
    Here is what I am doing
    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-mm-dd hh:mm:ss");
              java.util.Date today = new java.util.Date();
              String myDate=sdf.format(today);
    query = "SELECT Car_ID, Model_ID, Year, Ext_Color, Price from Cars where EDate <= "+myDate+" ;";
    EDate is the feild in the database and it's format is (5/12/2008 5:29:47 PM) it is of type Date/Time in MS Acess.
    when I execute the query it gives the following error
    SQL error:java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'EDate <= 2008-10-16 08:10:07'.
    I hope any one can help me with that error and answer my question, I've tried too many things but nothing helps
    Thanks in advance :-)

    Hi,
    When the comparision is needed to be done with the current date , we don't need to send in Java
    Date then format it and compare with MS Acess Date.
    In MS Access we have Date() function which will give you the current date.
    So you can try rewriting your query as following :
    query = "SELECT Car_ID, Model_ID, Year, Ext_Color, Price from Cars where EDate <= Date() ;"; ---------------------
    Hope this helps.
    Thanks

  • In the ReportDocument.Load method it tries to connect using the using the connection information embedded in the Report File

    Post Author: bhaveshbusa
    CA Forum: Crystal Reports
    In the ReportDocument.Load method it tries to connect using the using the connection information embedded in the Report File. When the application calls ReportDocument.Load(reportFileName). This
    tries to connect to the database using the connection information embedded in
    the "reportFileName". This was only realised on checking the ODBC Trace
    Log. The connection itself is not a problem. The problem is that the embedded
    connection information is related to OLD production system. And failed
    connections had raised some concerns.
    Note: I am using
    SetDataSource to populate the data for the report. So I don't need the
    connection.
    Is there any way I
    can disable this auto-connect?
    Thanks and
    regards,
    Bhavesh

    960738 wrote:
    I need a help in answering one of the issue encountered last week.
    I have created a database link and tried to access the information from a table using the program written in another language. The password provided was incorrect for that user while creating database link. So we expected that,while retrieving the data, Database connection has to be errored out as password provided is incorrrect.
    But unfortunately, user account was locked out. When i checked with DBAs they mentioned that it tries to connect 16 ports with in a min of time.we were shocked as it STOPS another scheduled jobs with that user. and affects production badly.
    As per the program, it has to connect only one time and yesterday we tried to execute the program in DBAs observation and it errored out as expected. Didn't tried for multiple ports.
    Now the question is, WHY the database connection established 16 times last week and caused user account locked. DBAs are unable to answer it. Any EXPERTs opinion on this would greatly appreciated.
    I have verified managing ports in oracle documentation, it was mentioned that if one port is busy it will try to connect to another port in the range of ports mentioned during the installtion. DBAs verified ports related file and it was blank. and they are not agreeing with this reason. Please HELP me in finding the correct REASON for this.
    is it a NETWORK issue or issue with DATABASE SERVER only?
    Thanks
    SSP
    Edited by: 960738 on Sep 22, 2012 9:13 PMDBLINK is 100% oblivious to the fact any port exists.
    DBLINK only contains username, password & TNS Alias.
    can you post actual SQL & results?

  • Calling report with no parameters from a form should report be a JSP file?

    Hi,
    I'm completely new to the Oracle environment and am having a few beginner problems all I want to find out is how to call a report from a form. I know this question has been asked before but I can't work it out from the answers because people seem to keep talking about rdf files:
    I am trying to call the report with the following code:
    Declare
         report_id REPORT_OBJECT;
         v_rep varchar2(100);
         rep_status varchar2(20);
    Begin
         report_id:= FIND_REPORT_OBJECT('EmployeeRep');
         v_rep := RUN_REPORT_OBJECT(report_id);
    END;
    My report is called 'EmployeeRep' but it saves it as a JSP file and there is no option to save as an rdf as is mentioned in other posts. I can understand the environments confusion because there is no directory information with the find_report_object command. Does the report have to be stored in a certain directory.
    All I have done with the report is created it from the emp table of the sample Scott database. Any help is appreciated and nothing is too obvious as I say I'm completely new to this.
    Thanks
    Dan

    Try to pinpoint what is going wrong:
    1. Run the report stand alone (from Reports Builder). If that doesn't work, then it won't work calling it from Forms either.
    2. Check if anything has run at all, or if there are report error messages with:
    http://localhost:port/reports/rwservlet/showjobs?
    For a standalone Report Server use:
    http://localhost:port/reports/rwservlet/showjobs?server=rep_server_name
    3. If it does work, call it from Forms. Is the report output file created (e.g. in the cache directory if destype=cache)? In your code you have run_report_object, but you won't see any output on your screen. To see the output add web.show_document(...) to your report. There are many examples in this forum if you search for run_report_object.

  • Unable to load the '.jsp' file

    Hi all,
              We use Weblogic 8.1 sp3 and are devloping a struts based application.
              I have deployed my 'ear' file (containing a '.war' and a '.jar' file). We use struts. Our '.war' file, contains the pre-compiled 'jsp' classes (we have changed our web.xml to indicate that we are using pre-compiled jsps. I can show my web.xml file if you need).
              When I click on my 'submit' button, I see that my action class has been invoked and it's spitting out messages to the stdout. Everything looks fine. But, when it is trying to load the '.jsp', I get the following error.
              <b>
              Error 500--Internal Server Error
              javax.servlet.ServletException: [HTTP:101249][ServletContext(id=20736651,name=gta,context-path=/gta)]: Servlet class jsp_servlet._presentation._jsp.__link for servlet /presentation/jsp/Link.jsp could not be loaded because the requested class was not found in the classpath C:\bea\8.1sp3\user_projects\domains\gta\gtaServer\stage\_appsdir_gta_ear\gtaweb.war;C:\bea\8.1sp3\user_projects\domains\gta\.\gtaServer\.wlnotdelete\extract\gtaServer__appsdir_gta_ear_gta\jarfiles\WEB-INF\lib\commons-beanutils20573.jar;C:\bea\8.1sp3\user_projects\domains\gta\.\gtaServer\.wlnotdelete\extract\gtaServer__appsdir_gta_ear_gta\jarfiles\WEB-INF\lib\commons-collections20574.jar;C:\bea\8.1sp3\user_projects\domains\gta\.\gtaServer\.wlnotdelete\extract\gtaServer__appsdir_gta_ear_gta\jarfiles\WEB-INF\lib\commons-digester20575.jar;C:\bea\8.1sp3\user_projects\domains\gta\.\gtaServer\.wlnotdelete\extract\gtaServer__appsdir_gta_ear_gta\jarfiles\WEB-INF\lib\commons-fileupload20576.jar;C:\bea\8.1sp3\user_projects\domains\gta\.\gtaServer\.wlnotdelete\extract\gtaServer__appsdir_gta_ear_gta\jarfiles\WEB-INF\lib\commons-lang20577.jar;C:\bea\8.1sp3\user_projects\domains\gta\.\gtaServer\.wlnotdelete\extract\gtaServer__appsdir_gta_ear_gta\jarfiles\WEB-INF\lib\commons-logging20578.jar;C:\bea\8.1sp3\user_projects\domains\gta\.\gtaServer\.wlnotdelete\extract\gtaServer__appsdir_gta_ear_gta\jarfiles\WEB-INF\lib\commons-validator20579.jar;C:\bea\8.1sp3\user_projects\domains\gta\.\gtaServer\.wlnotdelete\extract\gtaServer__appsdir_gta_ear_gta\jarfiles\WEB-INF\lib\jakarta-oro20580.jar;C:\bea\8.1sp3\user_projects\domains\gta\.\gtaServer\.wlnotdelete\extract\gtaServer__appsdir_gta_ear_gta\jarfiles\WEB-INF\lib\jstl20581.jar;C:\bea\8.1sp3\user_projects\domains\gta\.\gtaServer\.wlnotdelete\extract\gtaServer__appsdir_gta_ear_gta\jarfiles\WEB-INF\lib\standard20582.jar;C:\bea\8.1sp3\user_projects\domains\gta\.\gtaServer\.wlnotdelete\extract\gtaServer__appsdir_gta_ear_gta\jarfiles\WEB-INF\lib\struts20583.jar;C:\bea\8.1sp3\user_projects\domains\gta\.\gtaServer\.wlnotdelete\extract\gtaServer__appsdir_gta_ear_gta\jarfiles\_wl_cls_gen.jar.
              java.lang.ClassNotFoundException: jsp_servlet._presentation._jsp.__link.
                   at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:824)
                   at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:535)
                   at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:373)
                   at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:463)
                   at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:315)
                   at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:312)
                   at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
                   at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:274)
                   at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
                   at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:320)
                   at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
                   at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
                   at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
                   at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
                   at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
                   at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:996)
                   at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419)
                   at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:315)
                   at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6452)
                   at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
                   at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
                   at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3661)
                   at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2630)
                   at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
                   at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
              </b>
              I have looked in the '.war' file and it contains the above mentioned precompiled class (_link).
              Could anyone point me in the right direction??

    Hi,
              Could you check that whether the jsp file is placed in right place or not ?
              Regards
              Anilkumar kari

Maybe you are looking for

  • Messages stuck in Queue

    Hi I have a synchronous request response scenario using a ABAP proxy from a SRM system.The data gets written to a file system (Async) and we simulate a HTTP async response back to BPM from the File adapter, if file is written successfully.We close S/

  • Issue with Mail not using rich text

    I'm using the Mail app on snow leopard and I can't seem to utilize the rich text functionality within the program. It is set to "Rich Text" via Preferences -> Composing but all my emails come in as plain text ("Content-Type: text/plain; charset="us-a

  • BSI Message and Status

    When I simulate a payroll for an employee and review the processing for taxes; there is a BSI message: The system calculated tax results for the Bridgeville Local Services has been adjusted due to a substituted tax amount/rate.  When I look at the in

  • Analysis Process for a Procedure

    Hi Team, I have procedure of lines 1000 , i need to analysis (i.e need to understand the procedure flow) who it is working and what table is insert,update,cursor etc.... Please suggested me who to analysis a program. Thanks for advance. Edited by: 87

  • ATI RADEON 9600 PRO 256MB AGP VIDEO CARD PC/MAC

    This card is available from: https://www.directdial.com/100-435065.html My X800 XT blew up my logic board. This was the best 256MB card I could find. They had 30 of these when I ordered today at $209.