Jsp syntax

I am a MS developer and got thrown into a jsp project. I have been getting so many syntax error while coding and testing. Picky picky.
Here is my code and the error(s) are as follows:
<form action="ChangeSorting.jsp?recordView=<jsp:getProperty name='CumulusBean' property='recordView'/>" id="changeSortingForm" target="invisibleFrame" method="POST">
<td>
<select name="uid" size="1" onChange="document.getElementById('changeSortingForm').submit();">
<option value="">UnSorted</option>
<!--Line 21--><%if session.getAttribute( "theUid" ).equals ("Asset Format") {
strCheck = "selected";
} %>
<option value="{1e58eab1-f625-4d6b-be82-ef0ea493cb7a}" <%= strCheck %> >Asset Format</option>
</select>
</td>
</form>
An error occurred at line: 21 in the jsp file: /Copy of Standard/RecordViewContentHeader.jsp
Generated servlet error:
Syntax error on token "if", ( expected after this token
An error occurred at line: 21 in the jsp file: /Copy of Standard/RecordViewContentHeader.jsp
Generated servlet error:
Syntax error, insert ") Statement" to complete IfStatement
What is the problem? I'm just trying to create a drop down that shows the selection that the end user has chosen.
Thanks,
Luis

Thanks for the prompt response - it did correct the error.
Now I have a different problem:
                    <td class="textNormal">
                         Sort By:
                         uid= <%=session.getAttribute( "theUid" )%>
                         <%%>
                         <%String     strCheck = new String("xxx");%>
                    </td>
                    <form action="ChangeSorting.jsp?recordView=<jsp:getProperty name='CumulusBean' property='recordView'/>" id="changeSortingForm" target="invisibleFrame" method="POST">
                    <td>
               <select name="uid" size="1" onChange="document.getElementById('changeSortingForm').submit();">
               <option value="">
               UnSorted
               </option>
               <%if (session.getAttribute( "theUid" ).equals ("{1e58eab1-f625-4d6b-be82-ef0ea493cb7a}")) {
               strCheck = ("selected");
          }else {
System.err.println(strCheck);     
               } %>
<option value="{1e58eab1-f625-4d6b-be82-ef0ea493cb7a}" <%System.out.println(strCheck);%> >
Asset Format
</option>
</select>
</td>
                    </form>
I want to create drop down that shows the selection after it has been submitted. In order to do this I pass the parameter via a seesion variable (session.getAttribute( "theUid" ). I need to compare the string value in this variabler to the option value in the drop down and if they match, then insert a 'selected' in the option so it shows itself to the user.
I want to put 'xxx' into the variable just to test if in fact it is accepting the value.
Thanks,
Luis

Similar Messages

  • Mixing XML syntax w/JSP syntax

    As I understand it, you can use either the JSP-specific syntax or an XML-based syntax for code in a JSP page. For instance you can use either
      <%= expresssion %>(JSP-specific syntax)
    or
      <jsp:expression>
        expression
      </jsp:expression>(XML-based syntax)
    to do much the same thing. But I think once I heard somewhere that the two syntaxes cannot be mixed on the same JSP page. Two questions about that:
    (1) Is it true?
    (2) If it is true, what about a page of one syntax that includes (using include directive) a page of the other syntax -- there will be inconsistency here.
    Thanks if you can answer this.

    A jsp source file(.jsp) should be in either Xml syntax or Jsp syntax.

  • Howto: disable online jsp syntax check

    Can I disable online jsp syntax check?

    Federico -
    If you're referring to the text which 'pops up' as you are typing, this is called code insight. You can disable or change
    settings by navigating to Tools -> Preferences -> Editor -> Code Insight.
    Hope this helps,
    Lynn
    Java Tools Team

  • How to find JSP syntax Errors

    Dear All.
    I develop JSP in EP environment by NW Studio, I fond it is difficult to find JSP syntax Errors when I wrote the JSP, I ever view EP log, but the information is so general, it only told me "Error occurs during the compilation of java generated from the jsp" and so so, I can't find more detail information , could you tell me how can I find the syntax Errors quickly?

    Hi,
    The error should be somewhere in the log or trace file.
    Try default.trc in Visual Administrator (Log viewer) to look for more detail.
    Another possibility is to look for plugins that are compatible with NWDS and that can (pre)compile JSP's. Anyone....?
    In general is it is wise to keep your JSP's small, so use jsp:include (or page include) where possible. Also to avoid duplication of code. Indentation also helps to keep code readable.
    Good luck,
    Roelof

  • How to access dataprovider through jsp syntax

    I am creating an image gallery but here's my issue...
    I have a database table that contains links to images on my file system. I created a dataprovider for this database table on my page so the dataprovider now returns all the image links.
    Now what I need to do is create a row of thumbnails so I add a scriptlet in my jsp code where I want the thumbnail to appear. This scriptlet loops through the dataprovider and for each row it will create a standard html image tag populating the src attribute with the link from the dataprovider.
    I figure creating dynamic html img tags is much easier than creating dynamic image components in the backing bean. Doing the former allows me to output the row of thumbnails exactly where I want them on the page (ie where i put my scriptlet code) and is easier to manage.
    The problem is i don't know how to access the dataprovider through jsp tags and syntax. I'm sure there must be a way, can anyone help?
    Thanks.

    I've done this sometimes using scriplets:
    <%
        request.setAttribute("SOME_CONST", Constants.SOME_CONST);
    %>
    <c:out value="${SOME_CONST}" />But I would also be interested if anyone knows a way without those ugly scriplet..
    O

  • JSP Syntax check in editor

    Hi,
    After I upgraded my jdeveloper from 10g to 11.1.2.3 i saw a lot of syntax errors in JSP editor due to classes not found.
    For example my JSP file test.jsp contains:
    <%@include file="header_file.jsp"%>
    <% MyClass.doSth(); %>
    where header_file.jsp includes line
    <%page import="package.MyClass"%>
    Then MyClass will be underlined with red line saying "Name MyClass not found."
    If I include line
    <%page import="package.MyClass"%>
    directly in test.jsp file, then it will be fine.
    Any configuration am I missing?
    Thanks,
    Ruiling

    In that case you need to do a Outer join. A Inner join will still give the same result.
    Something like this
    select min(cnt) min_count, max(cnt) max_count
      from (
              select geo.mountain, count(distinct province) cnt
                from mountain m
                left join geo_mountain geo
                on geo.mountain=m.name
               group by m.name
    select min(cnt) min_count, max(cnt) max_count
      from (
              select geo.province, count(distinct mountain) cnt
                from province p
                left join geo_mountain geo
                on p.name=geo.province
               group by geo.province
           );Edited by: Karthick_Arp on May 2, 2013 3:51 AM
    Added query

  • JSP Syntax Highlighting

    Does anyone know how to configure Syntax highlighting for JSP's in JDeveloper v3.2?
    Thanks
    Mark

    You need a plugin which supports JSP.
    MyEclipse does (along with a lot of other stuff)
    Lomboz also provides a jsp editor
    You can find a whole lot of eclipse plugins at
    http://www.eclipseplugincentral.com/
    http://eclipse-plugins.2y.net/eclipse/index.jsp
    Cheers,
    evnafets

  • Turn off JSP syntax coloring in 12c

    How do I turn off syntax coloring for *.jsp files.
    JDeveloper CRASHES and CRASHES and CRASHES or HANGS or SOMETHING ELSE WRONG whenever I try to edit a JSP file.
    I just want JDeveloper to handle the file like a POTF (Plain Old Text File) since it cannot correctly handle it as is.
    Quite honestly, and I am not trying to disparage anyone, the JSP handling is HORRIBLE. I have to use Notepad++ to edit these files because JDeveloper just HANGS. Actually it cannot even crash. I say "Save all files and exit" in the panic dialog and it neither saves the files or exits.

    JDeveloper version is 12.1.2.0.0
    WIndows 7 64 bit w/16GB of memory.
    MaxPermSize is set to 2048M.
    I am happy to increase the amount of memory, but that doesn't appear to be an issue. :-)
    I have SQLServer running locally but limited to 2GB of memory. And I am running a local Tomcat server with a 3GB perm memory.
    And then I have all of the usual windows stuff running including corporate email (i.e. Outlook).
    TIA. I just want it to work. :-)

  • Jsp syntax for avoiding caching of pages at client

    how can we avoid a jsp page from caching
    which is so in ASP
    response.expires
    what is that in jsp

    If you are using Apache as your WebServer look at
    http://httpd.apache.org/docs/mod/mod_expires.html
    You can solve the caching problem by adding
    ExpiresActive On
    ExpiresDefault "access plus 1 second"
    to the Apache httpd.conf file
    null

  • JSP Syntax for binding JSF components

    I am trying to bind to a map with session scope and the key into the map is
    a string value. It seems that this binding does not work as the key is not found
    before rendering.
    <f:selectItems id="listbox1SelectItems" value="#{idGeneratorBean.myIds['key']}"/>
    The key is a hidden field on the page, and if hard-coded in the above, it will find that data.
    I've seen other postings where the binding is done in the component's initialization code.
    If it is done that way, what should the jsp binding look like?

    Please don't crosspost topics over all places. Stick to one topic.
    Continue here: [http://forum.java.sun.com/thread.jspa?threadID=5299291]

  • XML syntax error in a JSP page.

    Hi,
    i was trying to include xml syntax in a jsp page in stead of core jsp syntax. it didn't work.But the jsp document with the core jsp syntax works. I'm wondering what's the problem.any help would be really helpful. I'm using Tomcat 3.2.1.
    Thanx in adv,
    Ganesh
    JSP file - NOT WORKING
    <jsp:directive.page import="java.util.Date"/>
    <jsp:declaration>
    private static String loadTime = new Date().toString();
    private static String getLoadTime() { return loadTime; }
    private static String getCurrentTime() { return new Date().toString(); }
    </jsp:declaration>
    <HTML>
    <HEAD><TITLE>XML and JSP</TITLE></HEAD>
    <BODY>
    JSP page is created using XML syntax...<BR>
    This page was loaded into memory at <%= getLoadTime() %>.<BR>
    The current time is <%= getCurrentTime() %>
    </BODY>
    </HTML>
    ERROR :
    Error: 500
    Location: /test/declarations.jsp
    Internal Servlet Error:
    org.apache.jasper.JasperException: Unable to compile class for JSPC:\tomcat321\tomcat\work\localhost_8080%2Ftest\_0002fdeclarations_0002ejspdeclarations_jsp_6.java:59: Method getLoadTime() not found in class _0002fdeclarations_0002ejspdeclarations_jsp_6.
    out.print( getLoadTime() );
    ^
    C:\tomcat321\tomcat\work\localhost_8080%2Ftest\_0002fdeclarations_0002ejspdeclarations_jsp_6.java:65: Method getCurrentTime() not found in class _0002fdeclarations_0002ejspdeclarations_jsp_6.
    out.print( getCurrentTime() );
    ^
    2 errors

    Hi,
    any help on this question would be really appreciated..
    Thanx in adv,
    Ganesh

  • Where is JSP v2.0  Syntax Reference ?

    where is JSP v2.0 Syntax Reference ?
    I am looking for JSP v2.0 Syntax Reference
    but on searching i got
    1) http://java.sun.com/products/jsp/syntax/1.2/syntaxref12.html
    2) http://java.sun.com/products/jsp/technical.html
    finally i got
    3) http://java.sun.com/products/jsp/tags/tags.html
    i just want to confirm that the url no. 3 is the right resource that i am looking for ?
    if no, does any body know the correct url for JSP v2.0 Syntax Reference

    There is no HTML version of the JSP 2.0 syntax, that I know of. I use: http://java.sun.com/products/jsp/syntax/2.0/card20.pdf which is the syntax in a PDF.
    That version you have posted there appears to be an old version 1.0 page, but I can't tell. I know it does not contain everything in the JSP 2.0 specs.

  • Diff. between JSP format & XML based syntax

    i like to know the diff. between 2 types of jsp syntax,
    JSP - 1 - ordinary
    <% code %>
    JSP - 2 - XML based syntax
    <jsp:expression> code </jsp:expression>
    what is best to use for jsp development.,

    Haven't u finished fresher course yet?

  • Jsp:include does not work in 8.1 SP3?

    Hi all,
              I need to include a local file (external to the app) in jsp code. The external file includes an image map which changes very so often. So in order to avoid doing a build everytime, I thought about keeping the image map in a file which can be "included" in the jsp file, making it very dynamic to a change.
              So I have a servlet which will read this file and output the contents to response.getWriter(), which will be included in calling jsp code.
              But the jsp file does not seem to call the servlet at all.
              Here is the code in the jsp file:
              <%
              String sFileUrl = "/Prj/RenderReport?file=OrgChart.html";
              %>
              <jsp:include page="<%=sFileUrl%>" />
              What am I doing wrong? Is this not possible at all?
              Thank you all in advance.

    hi pjoshi,
              <jsp:include page="hello.jsp" /> tag is working fine in weblogic 8.1 sp3.
              I think it might be syntax error in your jsp page.
              This is the syntax to including dynamic files in jsp using <jsp:include page="" />tag as given below.
              <jsp:include page="{relativeURL | <%= expression %>}" flush="true" />
              go through the below link and you will find exact information how to include dynamic files in jsp using <jsp:include page=""/>
              http://java.sun.com/products/jsp/syntax/1.1/syntaxref1112.html
              --Anilkumar kari                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to use List String in JSP page?

    Hello All,
    I am having problem using List<String> in my JSP page. Below is my JSP code.
    <%@ page import="java.util.*, java.io.*"%>
    <html>
    <body>
    <h1 align="center">Beer Recommendations JSP</h1>
    <p>
    <%
    List<String> beerBrands = (List<String>)request.getAttribute("styles");
    Iterator<String> it = beerBrands.iterator();
    while(it.hasNext()){
         out.print("<br>try: " + it.next());
    %>
    </body>
    </html>
    When I compile the above JSP code in Eclipse 3.4 (using JBoss 4.2 as my Application Server), I get the following Warning.
    Type safety: Unchecked cast from Enumeration to Enumeration<String>
    If I add the "@SuppressWarnings("unchecked")" to the code, Eclipse does not give any Error during compilation. But, at runtime, I get the following Error.
    org.apache.jasper.JasperException: Unable to compile class for JSP:
    An error occurred at line: 10 in the jsp file: /BeerAdvice.jsp
    Syntax error, annotations are only available if source level is 5.0
    7: <p>
    8:
    9: <%
    10: @SuppressWarnings("unchecked")
    11: List<String> beerBrands = (List<String>)request.getAttribute("styles");
    12: Iterator<String> it = beerBrands.iterator();
    13: while(it.hasNext()){
    An error occurred at line: 11 in the jsp file: /BeerAdvice.jsp
    The type List is not generic; it cannot be parameterized with arguments <String>
    8:
    9: <%
    10: @SuppressWarnings("unchecked")
    11: List<String> beerBrands = (List<String>)request.getAttribute("styles");
    12: Iterator<String> it = beerBrands.iterator();
    13: while(it.hasNext()){
    14:      out.print("<br>try: " + it.next());
    An error occurred at line: 11 in the jsp file: /BeerAdvice.jsp
    Syntax error, parameterized types are only available if source level is 5.0
    8:
    9: <%
    10: @SuppressWarnings("unchecked")
    11: List<String> beerBrands = (List<String>)request.getAttribute("styles");
    12: Iterator<String> it = beerBrands.iterator();
    13: while(it.hasNext()){
    14:      out.print("<br>try: " + it.next());
    Any help is very much appreciated.
    Thank you for your help.
    Thanks,
    Chubha

    Hi anotherAikman,
    Thank you for your help. I currently have the following version of the Java.
    {color:#800000}java version "1.6.0_17"
    Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
    Java HotSpot(TM) Client VM (build 14.3-b01, mixed mode, sharing)
    {color:#000000}{color:#000000}Does it mean I have Java SE Version 6 Update 17 and you are suggesting me to download the Java EE Version 6?{color} If this is correct, can you please let me know what difference does it make?
    I am now going to install the Java EE 6 and try this out.
    Thank you for your help.{color}
    {color:#000000}Thanks,
    Chubha{color}
    {color}

Maybe you are looking for

  • Display report in PDF w/o save

    Hi, I want to display Report on xmii browser without saving , I tried PDF action but it is giving error when calling url "File doesn't begin with %PDF-". When using image saver for saving file it saved on given path successfully. I also used isBinary

  • Problem in material transactions distibution

    hi I have created a purchase order, made receipt When I see the receiving transactions, view receiving transactions summary it is ok I can see the valid data But when I open the material transactions form or transaction summries form in inventory and

  • Application icon becoming Address Book when "Stacked"

    my problem is simple: when i move my Applications folder down to the dock so that i can use it as a stack, its icon changes to the Address Book. the first time i click the Application icon, it does not open. the second time, it opens but the icon bec

  • Attendant console ver 1.4 (1ES11) context menu greyed out during transfer

    Please help save what little hair I have left, intermittently when our reception right click an incoming call in AC and attempt to transfer call the context menu is all greyed out and they are unable to transfer the call, using shortcut keys and tool

  • VS2008 CR basic Data not saving with report

    I have a Windows forms app with a CR developed in VS2008. The report displays correctily in the report viewer control and I also save it as a .rpt file. When I open this file in Crystal Reports Viewer 2008 I get the error that there is no saved data.