Cusotm Tags; Output Jsp script

Hi All,
I have an issue i would like to settle, and for this i need your help.
I'm trying to implement custom tags within my jsp pages. These custom tags will contain component code (mainly html tables etc). These components each have there own jsp tags within. When i try to output the component, the component is shown but the jsp tags within it are not processed so usually finish the script such as <c:out ... etc! i would like for that to be rendered before it is outputed by the BodyTagSupport .
Regards
Nick

The lifecycle of jsp tags and the way they are evaluated makes it impossible to do what you seek. Jsp tags write html output to the browser - they cannot generate output which can be further processed by the jsp engine. Thus if the output of a jsp tag is code containing more tags, those tags would be printed out to the browser - they wouldnt be taken up for evaluation.
ram.

Similar Messages

  • Javascript !--ipt tag in jsp    newbie question

    My jsp engine and/or the server is mangling javascript's <script> tag. Any ideas?
    I'm using Tomcat 4.0.3 and JDK 1.3.1_01. Will appreciate any help.
    Regards,
    Tom
    1.
    Original jsp:
    <SCRIPT language="javascript">
    // javascript code
    </SCRIPT>
    As seen by browser:
    <!--IPT language="javascript">
    // javascript code
    </SCRI-->
    The intermediate java source code produced by the jsp-compiler looks fine, e.g.:
    out.write("\r\n\r\n<html>\r\n<head>\r\n\r\n<SCRIPT language=\"javascript\">\r\n\r\nfunction test()\r\n{\r\n\talert(\"testing\");\r\n}\r\n\r\n</SCRIPT>\r\n</head> etc.
    2.
    Tried several other ways of generating the script tag. Result so far has been the same as above.
    a)
    <%= "<script ...>"%>
    b)
    <scr<%= "i"%>pt>

    Putting it inside the JSP comments <%-- <script> ... </script> --%>
    isn't working for me. Results in the entire javascript code not being outputted.
    By the way, if you notice the subject line, that's a similar phenomenon. I'd actually typed in "Javascript <script> tag ..." in the original subject line...
    Any other ideas?
    Tom

  • Escaping tag output for use in XHTML document?

    I'm converting a JSP page from HTML to XHTML, and have run across a problem with tags outputting XHTML-invalid characters (&'s and <'s). For example:
    <form action="<f:postResults />">
    postResult returns a string with those invalid characters, and so far I've been unable to figure out how to work around that. Any ideas?

    Our print publications are created in InDesign CS5 for Mac then the text is exported to RTF files then sent to an outside company to be converted to our XML specifications for use by our website developers.  I would like to create a workflow in which our XML tags are included in the InDesign layouts and then export the XML from the layouts.
    Some more detail about what kind of formatting is necessary might be helpful.
    I know that IDML files contain the entire layout in XML format.  Is it a good idea to extract what we need from IDML, using the already-assigned tags?
    Well, if you want to export the whole document, it's the only reasonable approach.
    We use a workflow system such that each story is a seperate InCopy document, stored in ICML format (Basically a subset of IDML). Our web automation uses XSLT to convert each story into HTML for use on our web site; it also matches it up with external metadata so it knows what is a headline and what is not, etc.. It is not exactly hassle free, and every once in a while someone uses a new InDesign feature that breaks things (e.g., our XSLT has no support for paragraph numbering, so numbered paragraphs show up without their numbers).
    You could do the same thing with with IDML, you'd just have to pick out each story, but that's small potatoes compared to all the XSL work you're going to have to do.
    On the other hand, there may be better approaches if you're not going to export the whole document. For instance,  you could use scripting to export each story as an RTF file, and then you could convert the RTF files into HTML using other tools.

  • Calling jsp custom tag from jsp expression

    hi there,
    I have a problem calling oracle(or any other) custom tag from inside a jsp expression.(i.e.)embeding <jbo:tagname...> into <%......%>.
    For example:
    I need to get the value of a jsp parameter, but the parameter name is dynamic (retrieved from a DataBase)
    So I though it would be something link that:
    <%=request.getParameter(<jbo:ShowValue datasource="ds" dataitem="ParamName" ></jbo:ShowValue>) %>
    where <jbo:ShowValue is an Oracle custom tab that retrieves the value of a certain dataItem(certain field).
    But it does not work.........
    if any body can tell me how to overcome, or work around it, I'll be so pleased.
    Regards,
    Remoun Anwar

    Hi,
    You get the custom tag output into a hidden variable (say 'key') and use the request.getParameter("key")
    Hope u got the answer...
    Regards
    ravi

  • How to display data containing CDATA tags in JSP/HTML?

    Hi,
    I'm getting some data from a webservice and displaying it in JSP. But some data from the service (like description of an item) contains CDATA tags.
    For ex: This is the data from the webservice.
    <BenefitsIssues><![CDATA[This strategy buys after a very rapid or extreme sell off with the hope that the gap will eventually be filled. <br>Typically, traders following these types of strategies expect some very large losses as downtrends continue.<br>Traders should take only very small positions when trading this strategy and never dedicate more than a small amount of risk capital in aggregate to this strategy.]]></BenefitsIssues>
    where <BenefitsIssues> is the XML tag. My code displays everything within this tag in JSP.
    Code is JSP looks like this.
    <tr><td><%=strategyDescriptor.getBenefitsIssues()%></td></tr>
    Eventually the HTML output of this JSP looks like..
    <tr><td>![CDATA[This strategy buys after a very rapid or extreme sell off with the hope that the gap will eventually be filled. <br>Typically, traders following these types of strategies expect some very large losses as downtrends continue.<br>Traders should take only very small positions when trading this strategy and never dedicate more than a small amount of risk capital in aggregate to this strategy.]]</td></tr>
    Problem is that the page fails to display the first line, "This strategy buys after a very rapid...." and starts displaying only from "Typically, traders following these....", i.e after the occurrence of first <br> tag. Page also displays "]]" at the end.
    How I can get rid of this problem? One way is to remove "![CDATA[" and "]]" from the data received from webservice. I would like to know if any other better solutions is there. Is there any predefined function to remove "![CDATA[" ?
    Thanks in advance for the help.
    -Prasanna                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    write tha bean class with the return type like. vector,arraylist .
    add the result set values to vector.
    for example
    Vector s = new Vector();
    while(rs.next)
    s.add(rs.getString());
    at last return that s.
    return s;
    // IN Jsp page;
    <ur dropdown come here>
    <%
    Vector Test = new Vector();
    Test = call function contains databasevalues();
    for(int i=0;i<Test.size();i++)
    %>
    <option><%=Test.get(i)%></option>
    <%}%>
    %>
    Message was edited by:
    kamal_shan

  • Why JSP Script Always Run First...

    Hey' i don't understand about this code works, why when i run this page, it always print start in console before i click the button.
    This is my code :
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title>JSP Page</title>
            <script language="Javascript">
                function checkButton(){       
                    <%
                    /* This declaration will print in console
                     * every time the page load.
                     * it suppose to be print after i click the buttonCheck button. */
                        System.out.println("start");
                    %>          
            </script>
        </head>
        <body>
             <form name="myForm">
                   <input type="button" value="check" onClick="checkButton()" name="buttonCheck">
             </form>
        </body>
    </html>Why my JSP Script always run before i click the button? JSP script must be run after i click my button. is there any explanation about this?
    Thanks..
    Message was edited by:
    hudoq

    the jsp scriptlet tag will be execute while compilation.
    so all the scriplet tags will be compiled and
    executed while loading. This is generally not 100% true. JSP files will be compiled only once in the fresh server start. This also explains the "long loading time" on the 1st view ;) The subsequent views just executes the already compiled JSP.

  • How can I pass information from jsp script to javascript

    Hi, there,
    in my project, after the user login successfully, I want to pop up a window using javascript to show some information retrieving from the database, for example, what's the user's firstname, lastname, visittimes, etc. these information is just visible in jsp script, so I don't know if there is a way to pass these information to javascript, for example, alert window to show these information to the user.
    any hint will be great appreciated!!
    thank you very much for your great help!!

    One possibility would be to use a Login PEI to set a unique UserInfo Name/Value for the user. I think in 5.0 each guest session is unique, so would have unique UserInfo. Then you could pass this value to your portlet (by specifying it in the web service) and use it as a key into a Application-scoped hashmap where you store your info. In other words, your Application variables option, but you have a way of uniquely naming your variables via PEI-set UserInfo.

  • Tcode to view  output of script RT_CHECK_LIST (in. delivery  checklist)

    Hi All,
       I want to see the output of script RT_CHECK_LIST which is assigned in NACE transaction.
      Details are as follows:
      Output type  : CHKL  (Count list)
      Application   :  E1      (Inbound delivery)
      Medium        : Print output
    Program        : RTCHECKL
    Form routine : ENTRY_CHECKLIST_LIEF
    Form              : RT_CHECK_LIST   
    As it shows that it is relared  to Inbound delivery , so I  tried  to see it by VL33 (delivery no ) ->(menu)inbound delivery -> output -> printer.
    But it is giving message that "No output has been selected".
    Tell me if any other way  to view the output.
    Regards,
    Rajeev Goswami

    Hi
    Go through VL32n....and add new entry for your output type.
    Also press Information button on output screen and check your output type if it is allowed.
    If not ask functional consultant to configure it for you
    Edited by: Vinit Joshi on Mar 5, 2012 11:25 AM

  • How to use ugm:getGroupNamesForUser tag in jsp

    when I use the tag in jsp ,run in server,the console write"weblogic.servlet cannot be resolved or is not a field <p><ugm:getGroupNamesForUser username="weblogic" id="weblogic"/>"
    I don't how to use it,please tell me,thank you!

    I'm not sure why you are getting the console message, but here is how you might use the tag. This will simply print out the list of immediate groups (not parent groups) to which user "weblogic" is a member.
    &lt;%@ taglib uri="http://www.bea.com/servers/p13n/tags/userGroupManagement" prefix="ugm" %&gt;
    &lt;%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %&gt;
    &lt;ugm:getGroupNamesForUser username="weblogic" id="groupNames"/&gt;
    &lt;c:forEach items="${groupNames}" var="groupName"&gt;
    bq. &lt;c:out value="${groupName}"/&gt;
    &lt;/c:forEach&gt;

  • How to use custom tag in jsp

    sir
    plz tell me how to use custom tag in jsp.plz describe it.
    i will be thankful to u

    Do you want to use taglibs or develop custom tags? Either way take a look at these:
    http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/JSPTags.html
    http://www.stardeveloper.com/articles/display.html?article=2001081301&page=1
    http://www.onjava.com/pub/a/onjava/2000/12/15/jsp_custom_tags.html
    http://jakarta.apache.org/taglibs/tutorial.html
    http://www.ibm.com/developerworks/edu/j-dw-java-custom-i.html
    http://www.herongyang.com/jsp/tag.html

  • Object tag for JSP

    Hi all,
    I have a JSF code which is using <af:objectMedia> tag(supplied by Oracle ADF faces) for emdeding windows media player. But now i have to implement the same in JSP.
    So, is there any JSTL tag in JSP that embed any media player?? I don't want to use html object or embed tags.
    Please help me out in this.

    Hi Galileo,
    In place of XXXX could you pls try using the following and see if it works.
    #{SessionBean1.<Session Property>} or
    #{SessionBean1.<Session Property>.value}
    I hope this helps.
    Cheers :-)

  • Passing values to a JSP script from an Applet

    I am having problems to passing arguments to a JSP scipt.
    In the applet the following code is executed:
    URL scoreTrackerURL = new URL(applet.getCodeBase(), "newscore.jsp?name=foo&score=10000");
    URLConnection scoreTrackerConn = scoreTrackerURL.openConnection();
    scoreTrackerConn.connect();
    The JSP-script in the newscore.jsp looks like this:
    <%@ page language="java" %>
    <%@ page import="java.util.*" %>
    <%@ page import="java.net.*" %>
    <%@ page import="java.io.*" %>
    <%
    String name = request.getParameter("name");
    String score = request.getParameter("score");
    BufferedWriter writer = new BufferedWriter(new FileWriter("highscore.txt"));
    writer.write(name + ", " + score);
    writer.close();
    %>
    What am I doing wrong since this doesn�t work!!! I have very little experience of JSP and accessing these scipts from Applets...
    Dukecredits are waiting for You! :) Thank you!

    I tried your code and it works fine.
    public class AppletParam extends Applet {
        public void paint(Graphics g) {
         g.setColor(Color.red);
         g.fillRect(0,0, getSize().width, getSize().height);
         try {
             URL scoreTrackerURL = new URL(getCodeBase(), "newscore.jsp?name=foo&score=10000");
             System.out.println(scoreTrackerURL);
             URLConnection scoreTrackerConn = scoreTrackerURL.openConnection();
             scoreTrackerConn.connect();
         } catch(IOException ioe) {
             ioe.printStackTrace();
    }The call to System.out.println writes the URL that's to be called to the java console in the webbrowser, so you can verify that the method has been called.Any Exceptions that might occour within the method will show up in the same place
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
      <head>
        <title>New Score</title>
      </head>
      <body>
        <h1>New Score</h1>
    <%@ page language="java" %>
    <%@ page import="java.util.*" %>
    <%@ page import="java.net.*" %>
    <%@ page import="java.io.*" %>
    <%
    String name = request.getParameter("name");
    String score = request.getParameter("score");
    System.out.println("name=" + name + " score=" + score);
    BufferedWriter writer = new BufferedWriter(new FileWriter("highscore.txt"));
    writer.write(name + ", " + score);
    writer.close();
    %>
      </body>
    </html>Again a call to System.out.println . This time it results in the two parameters being written to the application server log file, so you can see if the jsp was called and what the parameters were.
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
      <head>
        <title>test af AppletParam</title>
      </head>
      <body>
        <h1>test af AppletParam</h1>
        <applet codebase="." code="kres_test.AppletParam" width=200 height=200>
        </applet>
      </body>
    </html>The html file with the applet. Remember to place the class file in the correct place. If not you will get an error message in the java console of the webbrowser.
    My tests was performed on a WebLogic 6.1 application server, but there's nothing special about your code, it ought to run on any decent J2EE application server.

  • Standard driver programs,output type ,scripts,smartforms for SD reports

    hi experts,
                  Can any one list all the standard driver programs,output types ,scripts,smartforms for SD reports.
    mani

    Hi,
    Check this out
    NACE
    You can track the form and the print program used for that form
    The Tcode NACE is used to link the Standard SAP forms (SCRIPTFORM or SMARTFORM) or the customized form or the new form to its respective print programs. Also the output types, Form entry are linked with their forms and print programs. In short term, i can tell u that configuration or customization of forms to print programs, assigning output types, form entry to the forms are done using this Tcode.
    NACE is used to create output type while creating the output type you will mention forms, and driver program.
    that will be maintained in the table TNAPR.if you create the output type using NACE then it will be automatically visible in table NAST and TNAPR.
    so check in NAST, TNAPR table
    http://help.sap.com/saphelp_erp2005/helpdata/en/c8/1989fe43b111d1896f0000e8322d00/frameset.htm
    Condition records in NACE?
    and
    NACE is used for message control customizing.
    Take a look at the following link
    http://help.sap.com/saphelp_nw04/helpdata/en/c8/198a1843b111d1896f0000e8322d00/frameset.htm
    and also
    NACE is used for message control customizing.
    Take a look at the following link
    http://help.sap.com/saphelp_nw04/helpdata/en/c8/198a1843b111d1896f0000e8322d00/frameset.htm
    If it helps reward with points..

  • Cannot Load JSP script.

    I made some war file, that include very simple logic. (jsp script call
              "HelloWorld" Stateless session bean).
              It works well in windows 2000, WLS 6.1 SP4,
              but I make new WLS server in Solaris Machine WLS6.1Sp4, it didn't work.
              there are error code...
              i wish to help me.. have a nice day..
              -- error --
              <Jan 30, 2001 10:39:17 AM KST> <Error> <HTTP>
              <[WebAppServletContext(203801,web,
              /web)] Error loading servlet: "callsession"
              java.lang.ClassNotFoundException: jsp_servlet.__callsession
              at
              weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClass
              Loader.java:180)
              at
              weblogic.servlet.jsp.JspClassLoader.findClass(JspClassLoader.java:36)
              at
              weblogic.servlet.jsp.JspClassLoader.loadClass(JspClassLoader.java:27)
              at
              weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubI
              mpl.java:598)
              at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:215)
              at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:154)
              at
              weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.
              java:370)
              at
              weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
              pl.java:240)
              at
              weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
              pl.java:198)
              at
              weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
              rvletContext.java:2637)
              at
              weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
              pl.java:2359)
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              >
              <Jan 30, 2001 10:39:17 AM KST> <Error> <HTTP>
              <[WebAppServletContext(203801,web,
              /web)] Servlet failed with ServletException
              javax.servlet.ServletException: Servlet class: 'jsp_servlet.__callsession'
              could
              not be loaded - the requested class wasn't found in the classpath:
              '/home2/bwc
              ho/local/bea/wlserver6.1/config/clustered_domain/applications/.wlnotdelete/w
              eb34
              034.war:/home2/bwcho/local/bea/wlserver6.1/config/clustered_domain/applicati
              ons/
              .wlnotdelete/WEB-INF/_tmp_war_clustered_domain_web/cls34035.jar:C:\DOCUME~1\
              BYUN
              GW~1\LOCALS~1\Temp\'
              at
              weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubI
              mpl.java:609)
              at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:215)
              at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:154)
              at
              weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.
              java:370)
              at
              weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
              pl.java:240)
              at
              weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
              pl.java:198)
              at
              weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
              rvletContext.java:2637)
              at
              weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
              pl.java:2359)
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              >
              

    Ok it's me again.<br><br>
    I work for two days on this problem and cannot find a way to access a jsp page on sun one web server 6.0 SP9. What a crap man !<br><br>
    I read the online documentation from sun web site and did the 3 following thing in order to get JSP Engine working.<br><br>
    Firstly , I went to : Web Server Administration Server --> Global Setting tab -->Configure JRE/JDK<br>
    There I specified my JDK since it is mandatory to develop or deploy uncompiled JSP. FYI I use JDK 1.2.2.<br><br>
    Secondly, I include the following element in my web-apps.xml <jsp-servlet enable="true"/><br><br>
    Thirdly, I include The file tools.jar in my JVM Classpath.<br><br>
    The jsp file is not working, and I still get the same error as specified below...<br><br>
    Am I missing something ???<br><br>
    Thanks !<br><br>
    Dan.

  • How we can check the output in script

    hi friends,
    iam raju. new to sap.plz any one reply to my question.
    Thanks,
    raju

    Hi Sreenivasulu,
    You can check the output of script in two ways.
    1. Directly executing your print program u can see the output of SAP Script.
    2. IF you are using any standard scripts you then need to use t-code to see the output.
    Ex: if you are copied standard SAP Script (purchase order ) <b>MEDRUCK</b> this is the standard purchase order script.
    Copy this into your Zmedruck edit it as per ur requirement then you have to assaig this script to standard print program of purchase order using <b>NACE</b> transaction. Replace MEDRUCK with Zmeduck which u hv edited. Then for Purchase order the T-code is<b> ME9F</b>  give the purchase order no and check the output. There you can see the chages you have done in the script.
    Hope this will help you.
    <b>reward if useful</b>
    Regards,
    sunil kairam.

Maybe you are looking for

  • We need to be able to lock ipad folders. (or is there an app I cant find?)

    We use our ipad as a communication and education tool for my son who has autism.  I want him to have free access to certain apps, but not others.  I would think the ability to lock an app folder is the simplest solution and I don't know why this is n

  • BI Publisher- Display Parameters?

    How do I display parameters in a report? I do a select * from table_name where vendor_name = :parameter1 and start_date = :parameter2 and end_date = :parameter3 I can display all the * but the parameters...how do I show them?

  • Trick question about EventListeners & MovieClips

    Heya, I have 2 MovieClips, a square and over it an animation. I want to add a MouseEvent.CLICK to the square and be able to click it without removing the animation. Something like changing the index of the instances but without making the square over

  • Closing Programs running on Iphone3GS

    Hi How can I close any running programs in the background of my Iphone.  My battery seems to be draining quite quickly, I can't tell what is still open. TIA

  • Pop up window at the start of launching labview vi.

    When my labview vi is launched, I would like to first display a window that requests a serial number and when this has been entered, the window disappears and the main vi is launched which sequences all the tests for the unit identified. Can anyone g