New to JSTL: jsp variable translated literally within the custom tag

I have a basic custom tag that simply processes greeting. Neither of the below scenarios works and I am trying to understand why
<%
String name = (String)request.getParameter( "name" )
%>
<custom:greeting name="<%= name %>"/>
<%
pageContext.setAttribute( "name", name );
%>
<custom:greeting name="${name}"/>
If you have any suggestions, I look forward to hearing from you.

When i ran the code I get my "Hello <%= name %> "or "Hello ${name} "
My source
public class HelloTag extends TagSupport{
public String name = "World";
public void setName( String value )
name = value;
public int doEndTag()
try{
pageContext.getOut().println( "Hello " + name );
}catch( IOException e){}
public HelloTag()
super();
What do you mean by jsp level. It resides in my Root directory under Tomcat

Similar Messages

  • Tiles + JSF error (Illegal to flush within a custom tag)

    Hi,
    When I try to use Tiles + JSF I have this error message :
    javax.servlet.jsp.JspException: Illegal to flush within a custom tag
    I am already using flush="false" on my tiles:insert tag.
    This is my .jsp code :
    <%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
    <tiles:insert beanName="cadastro_base" beanScope="request" flush="false">
    <tiles:put name="form_body" type="string">
    <f:view>
    <h:form id="DisciplinaJsfBean" binding="#{DisciplinaJsfBean.form}" >
    <h:inputText id="codigo" binding="#{DisciplinaJsfBean.itCodigo}"/>
    </h:form>
    </f:view>
    </tiles:put>
    </tiles:insert>
    And this is the stack trace message :
    exception
    javax.servlet.ServletException: Illegal to flush within a custom tag
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
         org.apache.jsp.security.disciplina.cadastrarDisciplinas_jsp._jspService(cadastrarDisciplinas_jsp.java:99)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
         com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
         com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
         com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
         com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
    root cause
    javax.servlet.jsp.JspException: Illegal to flush within a custom tag
         com.sun.faces.taglib.jsf_core.ViewTag.doEndTag(ViewTag.java:223)
         org.apache.jsp.security.disciplina.cadastrarDisciplinas_jsp._jspx_meth_f_view_0(cadastrarDisciplinas_jsp.java:205)
         org.apache.jsp.security.disciplina.cadastrarDisciplinas_jsp._jspx_meth_tiles_put_0(cadastrarDisciplinas_jsp.java:157)
         org.apache.jsp.security.disciplina.cadastrarDisciplinas_jsp._jspx_meth_tiles_insert_0(cadastrarDisciplinas_jsp.java:122)
         org.apache.jsp.security.disciplina.cadastrarDisciplinas_jsp._jspService(cadastrarDisciplinas_jsp.java:92)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
         com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
         com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
         com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
         com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
    Danilo.

    What worked for me was to add a flush="false" to each of the <tiles:insert tags in my layout page.
    I'm using this with JSF so it may be different for you:
    ... Layout stuff ...
       <tiles:insert attribute="body" flush="false" />
    ... More layout stuff, including more inserts with the flush="false" ....

  • Javax.servlet.ServletException: Illegal to flush within a custom tag

    Hi ,
    I am developing a sample application for JSF , Tiles and Spring when i uses JSF with tiles i am getting the error
    javax.servlet.ServletException: Illegal to flush within a custom tag
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
         org.apache.jsp.pages.main_jsp._jspService(main_jsp.java:84)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:298)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
         com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:142)
         com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
         com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
         com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
    Here is the My master tiles layout file
    <%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
    <HTML>
    <HEAD>
    <TITLE><tiles:getAsString name="title"/></TITLE>
    </HEAD>
    <BODY>
    <TABLE border="0" width="100%" cellspacing="5">
    <TR>
    <TD colspan="2"><tiles:insert attribute="header" flush="false" /></TD>
    </TR>
    <TR>
    <TD width="140" valign="top">
    <tiles:insert attribute='menu' flush="false"/>
    </TD>
    <TD valign="top" align="left">
    <tiles:insert attribute='body' flush="false"/>
    </TD>
    </TR>
    <TR>
    <TD colspan="2">
    <tiles:insert attribute="footer" flush="false"/>
    </TD>
    </TR>
    </TABLE>
    </BODY>
    </HTML>
    and here is the main.jsf
    <%@ taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
    <%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
    <%@ page contentType="text/html;charset=UTF-8" language="java" %>
    <%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
    <tiles:insert page="/pages/template.jsp" flush="false" >
    <tiles:put name="title" value="Hello World" />
    <tiles:put name="header" value="/pages/header.jsp" />
    <tiles:put name="body" type="string">
    <f:view>
    <h:form id="catalogMenu">
    <table border="1" align ="center" >
    <tr>
    <td><a href="<img src="../images/image1.gif"><br>Struts in Action<br><a href="Add to Cart $39.00</td>
    <td><a href=" <img src="../images/image2.gif"><br>Juint in Action<br><a href="Add to Cart $35.00</td>
    </tr>
    <tr>
    <td><a href="<img src="../images/image3.gif"><br>Hibernate in Action<br><a href="Add to Cart $50.00</td>
    <td> <a href="<img src="../images/image4.gif"><br>Spring in Action<br><a href="Add to Cart $54.00</td>
    </tr>
    </table>
    </h:form>
    </f:view>
    </tiles:put>
    </tiles:insert>
    can any body please suggest why i this exception is coming

    What worked for me was to add a flush="false" to each of the <tiles:insert tags in my layout page.
    I'm using this with JSF so it may be different for you:
    ... Layout stuff ...
       <tiles:insert attribute="body" flush="false" />
    ... More layout stuff, including more inserts with the flush="false" ....

  • Tomcat4: Illegal to flush within a custom tag

    I tried to deploy to Tomcat4.1.18 a jsp-struts application developed with JDeveloper 9.0.3.1, simply obtained using the "Complete Struts-Based JSP Application" Wizard.
    When I access to a page containing the
    "jbo:DataRecord" tag or the "jbo:DataTable" I get this exception in the error log file (I do not know if other tags give this same error, but for example "jbo:DataScroller" does not):
    2003-04-15 09:28:35 ApplicationModule release mode is: Stateful
    2003-04-15 09:28:36 jsp: init
    2003-04-15 09:28:37 jsp: init
    2003-04-15 09:28:37 IO Error
    java.io.IOException: Illegal to flush within a custom tag
         at javax.servlet.jsp.tagext.BodyContent.flush(BodyContent.java:115)
         at oracle.jbo.html.jsp.datatags.ComponentTag.doStartTag(ComponentTag.java:69)
         at org.apache.jsp.PazientiDateEventiViewLink1_0005fDateEventiEventiViewLink1$jsp._jspService(PazientiDateEventiViewLink1_0005fDateEventiEventiViewLink1$jsp.java:157)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:202)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:683)
         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:431)
         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:355)
         at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1014)
         at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:417)
         at org.apache.struts.action.RequestProcessor.processActionForward(RequestProcessor.java:390)
         at oracle.jbo.html.struts11.BC4JRequestProcessor.processActionForward(BC4JRequestProcessor.java:98)
         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:271)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1292)
         at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:492)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.ajp.tomcat4.Ajp13Processor.process(Ajp13Processor.java:429)
         at org.apache.ajp.tomcat4.Ajp13Processor.run(Ajp13Processor.java:495)
         at java.lang.Thread.run(Thread.java:484)
    2003-04-15 09:28:46 jsp: init
    2003-04-15 09:28:46 ApplicationModule release mode is: Stateful
    Deploying on a standalone OC4J everything works.
    Is there some configuration to add to the web.xml file or somewhere else? I tried also on Tomcat 4.0.3 with same results.
    I added this lines in web.xml to avoid the problems descripted in thread BC4J entity objects vs EJB2.0 entity beans
    <init-param>
    <param-name>enablePooling</param-name>
    <param-value>false</param-value>
    </init-param>
    Other non-struts-based webapps developed with JDev 9.0.2 and 9.0.3 were deployed correctly on Tomcat 4.1.18.
    Thanks,
    Marco.

    Hi Steve,
    I looked better at my page and it has been modified from that produced by the wizard. In fact, the problem arises substituting a DataTable tag with a RowsetIterate in which I put a DataRecord.
    Here there is a simple page which produces this error (I see the error only in the error log of Tomcat localhost_log.txt, not on the page):
    <%@ page language="java" import="oracle.jbo.*" errorPage="errorpage.jsp" contentType="text/html;charset=windows-1252" %>
    <%@ taglib uri="/webapp/DataTags.tld" prefix="jbo" %>
    <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
    <html>
    <head>
    <META NAME="GENERATOR" CONTENT="Oracle JDeveloper">
    <LINK REL=STYLESHEET TYPE="text/css" HREF="bc4j.css">
    <TITLE><bean:message key="browse.title"/></TITLE>
    </head>
    <body>
    <jbo:DataTransaction appid="Test3Module" />
    <h3><bean:message key="browse.header" arg0="CategoryView1"/></h3>
    <table border="0">
    <tr>
    <td ALIGN="right"><jbo:DataScroller datasource="Test3Module.CategoryView1"/></td>
    </tr>
    <tr>
    <%-- REPLACED DataTable WITH a RowsetIterate in which I put a DataRecord --%>
    <jbo:RowsetIterate datasource="Test3Module.CategoryView1" userange="true" >
    <td>
    <jbo:DataRecord datasource="Test3Module.CategoryView1" />
    </td>
    </jbo:RowsetIterate>
    <%--
    <td><jbo:DataTable datasource="Test3Module.CategoryView1" edittarget="/edit_CategoryView1.do"/></td>
    --%>
    </tr>
    </table>
    </body>
    </html>
    In this case, it is not so hard to avoid to put in the pages such a code.
    Thanks,
    Marco.

  • WebLogic Server 7.0: Including another JSP from within a custom tag

    Hi all,
              has anyone made experience with including (ie. processing) a dynamic
              resource (JSP) from within a custom JSP tag?
              Using the following code inside doEndTag():
              pageContext.include("/templates/blub.jsp");
              throws a ServletException (Note: the JSP is a part of the web app
              which is deployed as war). Does it make a difference if the web
              application is warred up into and therefore include cannot resolve the
              specified relative URL?
              [Tomcat 4.1.10 doesn't have problems for that matter]
              The full stack trace is:
              javax.servlet.ServletException: java.lang.NullPointerException
              at com.foo.taglibs.template.InsertTag.doEndTag(InsertTag.java:55)
              at jsp_servlet._models.__index._jspService(__index.java:774)
              at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
              at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:945)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:332)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:376)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:242)
              at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:5360)
              at weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:721)
              at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3043)
              at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2468)
              at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133)
              TIA,
              niko.
              

    Try the same code from an exploded web app.
              Niko Schmuck wrote:
              > Hi all,
              >
              > has anyone made experience with including (ie. processing) a dynamic
              > resource (JSP) from within a custom JSP tag?
              >
              > Using the following code inside doEndTag():
              >
              > pageContext.include("/templates/blub.jsp");
              >
              > throws a ServletException (Note: the JSP is a part of the web app
              > which is deployed as war). Does it make a difference if the web
              > application is warred up into and therefore include cannot resolve the
              > specified relative URL?
              > [Tomcat 4.1.10 doesn't have problems for that matter]
              >
              > The full stack trace is:
              >
              > javax.servlet.ServletException: java.lang.NullPointerException
              > at com.foo.taglibs.template.InsertTag.doEndTag(InsertTag.java:55)
              > at jsp_servlet._models.__index._jspService(__index.java:774)
              > at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
              > at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:945)
              > at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:332)
              > at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:376)
              > at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:242)
              > at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:5360)
              > at weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:721)
              > at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3043)
              > at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2468)
              > at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152)
              > at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133)
              >
              > TIA,
              > niko.
              Rajesh Mirchandani
              Developer Relations Engineer
              BEA Support
              

  • Variable declaration in the custom tag

    Hey,
    I am using JSP2.0 to write a custom tag. and I need to declare a script variable in my tag so that it can be referenced in a jsp file. At the beginning, I used name-given and my tag works as it supposed to do. But I don't like to make the variable name hard-coded in my tag so that I changed name-given to name-from-attribute as folllows:
    <jsp:directive.variable name-from-attribute="var" alias="local" variable-class="java.util.ArrayList" scope="AT_END"/>
    <jsp:scriptlet>
    out.println(local.getClass().getName());
    </jsp:scriptlet>     
    According to my understanding, variable "local" should be able to be referenced in my tag file and when the tag created in a jsp file
    <tags:myTag var="myTest" />
    the variable myTest should be able to be referenced in this jsp file too. But whenever I try this in jsp: out.println(myTest.getClass().getName());
    I always got this error" myTest cannot be resolved"
    I am totally stuck here. Someone could please give me some hints? thanks a lot!

    Do you have a getter method to match that property?
    Post some example code - what does your tld define for this property, and what get/set methods have you defined for it?

  • Will search engines read the alt= text for a banner image within the h1 tag?

    I read where the search engines focus on the text within the
    header h1 tags. If I'm using a graphic that contains this important
    introductory info (as apposed to text), and put the text in the
    alt= section of the image, will the search engines us this text in
    the alt section of the image?

    Depends. I have a logo on my site with an alt description
    "orange kitten
    playing with planet Earth"
    Yahoo Web: My home page is #1
    Google Images: The image is #1
    Google Web: nada
    --Nancy O.
    Alt-Web Design & Publishing
    www.alt-web.com
    "Walt F. Schaefer" <[email protected]> wrote in
    message
    news:[email protected]...
    > I would speculate that if the words and phrases in those
    alt tags do NOT
    > appear elsewhere in the actual text (on that page) even
    those SEs that
    read
    > the alt tags will likely ignore them.
    >
    > --
    >
    > Walt
    >
    >
    > "Nancy O" <[email protected]> wrote in
    message
    > news:[email protected]...
    > > Yes and no.
    > >
    > > Do assign ALT description to your images. Screen
    readers, which are
    used
    > > by
    > > many visually impaired Web users, can't understand
    images. To ensure
    > > accessibility, an alternative description needs to
    be assigned to every
    > > image; the screen reader will read out this
    alternative, or ALT="image
    > > description goes here."
    > >
    > > Like screen readers, search engines are commonly
    assumed to be unable to
    > > understand images. But some search engines index
    ALT text. By assigning
    > > ALT
    > > text to your images, those engines will be able to
    understand even your
    > > pictorial content.
    > >
    > > Of course, numerous search engines don't take any
    notice of ALT text.
    The
    > > proliferation of ALT tag spamming undermined the
    relevance of ALT text
    in
    > > the eyes of these engines, which no longer consider
    it in their
    relevance
    > > algorithms.
    > >
    > > So, why bother with image ALT text? Because your
    rankings may improve in
    > > search engines that do take it into account, and it
    makes your site more
    > > accessible.
    > >
    > > --Nancy O.
    > > Alt-Web Design & Publishing
    > > www.alt-web.com
    > >
    > >
    > >
    > > "brainfillet" <[email protected]>
    wrote in message
    > > news:[email protected]...
    > >> I read where the search engines focus on the
    text within the header h1
    > > tags.
    > >> If I'm using a graphic that contains this
    important introductory info
    (as
    > >> apposed to text), and put the text in the alt=
    section of the image,
    will
    > > the
    > >> search engines us this text in the alt section
    of the image?
    > >>
    > >
    > >
    >
    >

  • Bex variable value manipulation in the customer exit

    Hello Experts - I have a situation where I need to manipulate the value of a variable in the customer exit based on certain conditions. I have a customer class variable defined in the query with the processing by Manual Input/Default Value. I need to restrict the values that this variable gets based on values that are selected for another variable (division). For example if the division value is 01, class variable can not have value 'CB'. Any ideas how this can be accomplished. Any input will be appreciated.
    Rgds,
    Venu.

    Mansi & Guy - Thanks for your input. The query is not used interactively and it is used as dashboard query in VC for which the variables are fed via Adobe Flex application. In detail here is my requirement -
    Division is a mandatory field that is selected on the dashboard (You can think this for query)
    Class is a Optional field (users have option to select multiple values).
    If the users choose particular division (say in my case 04) and not any Class, at the query level, I want to exclude CB which I can do it in i_step3 logic.
    In case if the user selects any class, I want to skip the logic of exclusion in the i_step3 (This is because, I can restrict the user what class they can pick based on the Division they choose, so the i_step3 logic wouldn't be required in this case).
    Basically, I do not want to raise messages and this needs to handled based on user selections.
    Appreciate your help,
    Venu.
    Edited by: Venu on Sep 14, 2009 10:03 PM

  • Add task to notification from within the customer enhancement

    Is there a function module that will add a task to a notification from within a customer exit?  I've tried to use a BAPI within QQMA0014 (Save Exit) , but this interferes with the processing of the notification.  The imported internal task table for the exit can be manipulated, but I am not sure how, or what, needs to be present and would prefer using a function module.
    Thanks,
    Brian Basch

    Brian,
       I would activate the change document for the custom fields which will act as a trigger for a custom event(Even better than creating a generic event based on create / change notification) that would be tied to a simple single step standard task pointing to a create Task FM. I would use the exit on SAVE to update the custom fields for the task(You will have to enhance your BAPI to update the custom fields if you don't want to use this exit).
    Regards
    Narasimhan

  • Javascript gives an error while added externally or within the script tag

    I have included a Javascript that will return the id of the current element that I am accessing , i am using this script along with the jsf tags.
    The code looks like this :
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
    <html>
    <head>
    <script language="Javascript">
    function focus_id()
    alert(this.id);
    </script>
    </head>
    <f:subview id="task-tree">
    <t:div style="width:170px; height:500px; overflow:auto;">
    <t:tree2
       ... >
       <f:facet name="root-facet">
          <h:panelGroup>
             <t:graphicImage alt="#{msgs.openFolderAlt}" value="/images/dtree/folderopen.gif" rendered="#{t.nodeExpanded}" border="0"/>
             <t:graphicImage alt="#{msgs.folderAlt}"value="/images/dtree/folder.gif" rendered="#{!t.nodeExpanded}" border="0"/>
             <h:outputText value="#{node.description}" styleClass="nodeFolder"/>
          </h:panelGroup>
       </f:facet>
       <f:facet name="node-facet">
          <h:panelGroup>
             <t:graphicImage alt="#{msgs.openFolderAlt}" value="/images/dtree/folderopen.gif" rendered="#{t.nodeExpanded}" border="0"/>
             <t:graphicImage alt="#{msgs.folderAlt}" value="/images/dtree/folder.gif" rendered="#{!t.nodeExpanded}" border="0"/>
             <h:outputText value="#{node.description}" styleClass="nodeFolder"/>
          </h:panelGroup>
       </f:facet>
       <f:facet name="node-with-action-facet">
          <h:panelGroup>
             <t:graphicImage alt="#{msgs.openFolderAlt}" value="/images/dtree/folderopen.gif" rendered="#{t.nodeExpanded}" border="0"/>
             <t:graphicImage alt="#{msgs.folderAlt}" value="/images/dtree/folder.gif" rendered="#{!t.nodeExpanded}" border="0"/>
             <h:commandLink
                immediate="true"
                actionListener="#{t.setNodeSelected}"
                action="#{node.doAction}"
                styleClass="#{t.nodeSelected ? 'rowHighlighted' : 'document'}"
                onclick="focus_id();" >
                <h:outputText value="#{node.label}"/>
             </h:commandLink>
          </h:panelGroup>
       </f:facet>
       <f:facet name="leaf-facet">
          <h:panelGroup>
             <h:commandLink
                immediate="true"
                actionListener="#{t.setNodeSelected}"
                action="#{node.doAction}"
                styleClass="#{t.nodeSelected ? 'rowHighlighted' : 'document'}"
                onclick="focus_id();" >
                <h:outputText value="#{node.label}"/>
             </h:commandLink>
          </h:panelGroup>
       </f:facet>
    </t:tree2>
    </t:div>
    </f:subview>
    </html>This code works fine and returns the element id if included inline but not
    otherwise .... Any clues that you can give me as to why this happens will be great ...

    Problem was solved.
    It was some of illegial symbols at the beginning of xml.

  • How to get AEGP_EffectRefH within the custom effect?

    Hi,
        I want to get the AEGP_EffectRefH of the custom effect applied. This is what I'm trying to do:
    In global setup of custom effect:
    AEGP_GlobalRefcon globalRef    =    NULL;
    const A_char*        pluginName    =    "ADBE Custom Effect";
    AEGP_SuiteHandler    suites(in_data->pica_basicP);
    suites.UtilitySuite5()->AEGP_RegisterWithAEGP(globalRef, pluginName, &S_Plugin_ID );
    After getting the plugin ID, I do this in a function to get the AEGP_EffectRefH:
    I call this function when the custom effect is added:
    void function()
         AEGP_EffectRefH        effect_refH        =    NULL;
         AEGP_SuiteHandler    suites(in_data->pica_basicP);           
         ERR(suites.PFInterfaceSuite1()->AEGP_GetNewEffectForEffect(S_Plugin_ID, in_data->effect_ref, &effect_refH));
    But the effect_refH returned is NULL. AE pops up a dialog saying
    After Effects error: internal verification failure, sorry! {child not found in parent}
    (29 :: 0)
    What am I doing wrong?
    Thanks,
    Dheeraj

    about the reliability of effectRefs:
    they are reliable for the duration of one call.
    i.e. for the beginning to the end of the render call or updtate_params_ui call.
    after that cal has ended, the effectRef is likely to become invalidated.
    do an experiment:
    get an effect's effectRef, and check it's address in ram.
    releast the effetcRef and get another effectRef for a DIFFERENT effect.
    check it's adress and you'll be amazed that it has the same address as the first.
    why is that?
    because it doesn't point to the address of that effect in ram.
    it's an internal id that allows AE to operate on the effect for you.
    so that same effectRef you have, might point to a different effect or to nothing at all, once AE decides that the effectRef you acquired is no longer in use.
    AE will decide that after you release the effetcRef, or that you effect returns from it's call.
    so what does all that mean?
    it means you should treat effectRefs and a temporary key for accessing an effect, and NOT as a long term means of identifying and effect.
    there is no perfect solution for tracking an effect for long spans.
    if you want to keep track of an effect outside the scope of one call you have to:
    1. get the itemID for the comp it's in
    2. get the layerID for the layer it's on
    3. get the effect's index on the layer (this is the tricky bit)
    the comp's itemID and layerID both last for the lifetime of the project.
    they will keep across sessions, even if the project is loaded on a different machine and a different platform.
    these only get invalidated if the project is imported into another project.
    the index of the effect is the problem bit.
    there is no API call for getting an effects index.
    you can only tell the index by counting all effects on the layer, until you hit the desired effect.
    even then it's hard to tell because you tell what effect you hit by reading it's matchName.
    what if you have to copies of the same effect on one layer?
    how do you tell them apart?
    it's up to you to create a unique identifier.
    either a hidden slider holding a random value that's unique to each instance, or change the effect name to something unique (the user might change that without you knowing)
    the last problem with the index is that the user might change effects order on that layer, and your effect get no notification of that having happened.
    so even if you stored the itemID, layerID and effect index, you still have to make sure it's the correct effect before you do something hasty like access it.
    as i said,
    there is no perfect long term solution for tracking effects.

  • Accessing JSP Variables in Custom Tag Handler.

    Hi,
    I am creating a custom tag which builds a list view. I have certain String array in my JSP and I need to pass the same into my Tag Handler class. I tried following ways :
    1. In doStartTag() implementation I used
       public int doStartTag() {
             String[] myArray = (String[])pageContext.getAttribute("mystringarray", PageContext.PAGE_SCOPE;
       }This is not recognizing the String array variable defined in my JSP.
    2. I used separate attribute which is passed from the JSP to the custom tag as parameter having "rtexprvalue" as true. But I cann't pass a Sting array into my tag handler class. I can pass only String.
    How can I access variables which are defined in the JSP using declaration block. i.e.
    <%!
    String[] myArray = new String[100];
    %>
    Thanks for the time.

    You should be able to pass any type you like as an attribute to the tag.
    You just have to define its type as String[] in your tld:
    <attribute>
    <name>stringArray</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    <type>java.lang.String[]</type>
    </attribute>
    Alternatively, If you declare your array like:
    <%!
    String[] myArray = new String[100];
    %>You can do this:
    pageContext.setAttribute("mystringarray", myArray);
    which will put it into the page context for you to pick up in your custom tag.
    Hope this helps,
    evnafets

  • How can I obtain the value of a database column in a JSP variable ?

    How can I obtain the value of a table column in a JSP variable?
    For example the <jbo:ShowValue datasource="cl" dataitem="Cont" ></jbo:ShowValue>
    I need to have it in a variable like this:
    <% String cnt=<jbo:ShowValue datasource="cl" dataitem="Cont" ></jbo:ShowValue>; %>
    But it is not workig this way.
    Please help me to obtain the value.
    I am using JDev RC2.
    Thanks.

    Try something like
    String cnt = c1.getRowSet().getCurrentRow().getAttribute("Cont").toString();
    -A
    How can I obtain the value of a table column in a JSP variable?
    For example the <jbo:ShowValue datasource="cl" dataitem="Cont" ></jbo:ShowValue>
    I need to have it in a variable like this:
    <% String cnt=<jbo:ShowValue datasource="cl" dataitem="Cont" ></jbo:ShowValue>; %>
    But it is not workig this way.
    Please help me to obtain the value.
    I am using JDev RC2.
    Thanks.

  • Why am I unable to select within the URL bar of a new tab after opening a .pdf file in Firefox 4?

    To repeat the problem:
    1.) Open a .pdf file in Firefox 4
    2.) Open a new tab by using the (+) tab button
    3.) Try to select within the URL bar (unsuccessful)
    I cannot seem to direct my browser to a new website in a new tab after viewing a .pdf file within the browser.

    Restore your default toolbar by going to Customize - Restore Default Set. I just found it out myself.

  • How to use a variable of jsp custom tag in my java code?

    hi folks,
    i got a folderList tag like this:
    ArrayList list = new ArrayList(20);
    %>
    <foo:folderList path="${attributes.newsPath}" var="year" contentType="folder">
    <%
              list.add(${year.contentEntryName});   // of course, this doesn't work
    %>
    </foo:folderList>I think, its clear what I want to do. I am just wondering how I can use my Variable "year" in the Java code between <% %>...

    <% list.add(year.getContentEntryName()); %>
    You have to have defined in the custom tag that "var" relates to a scripting variable that you want defined.
    <tag>
      <variable>
        <name-given>var</name-given>
        <variable-class>myPackage.myClass</variable-class>
        <declare>true</declare>
        <scope>NESTED</scope>
      </variable>
    </tag> Cheers,
    evnafets

Maybe you are looking for

  • How to control DE USB disk Automounts.

    Hi, Can someone please guide me as to how to 'control' Automounts by DE when we plug USB disk drives. I have KDE4 on my Arch system. When I connect a pen drive/USB HDD which is formatted as vfat/NTFS, the system(or KDE) 'Automounts' it in /media and

  • MBPr+disconected external monitor= no auto graphics switching

    Hello! I am having a problem with automatic graphics switching. Recently i updated OS X to Mavericks and noticed that my MBPr not going back to integrated GPU when I disconect my external monitor. In Activity Monitor all processes are not requiring H

  • How to create a calendar in Calendar

    Is there a way to create a calendar in Calendar on my iPad 2? I would like to create a calendar on my iPad using Calendar, but I only want it on my iPad. I don't want to have to use another program, like Google Calendars, to create the calendar, then

  • Are there any current problems connecting the iWeb server?  I can't sign in.

    I've tried to publish for the last couple of days and receive an error message that the server isn't available and can't sign in

  • Can't find out why my DB is that big

    I've got a database which is 260 GB in size. Since I know the application behind the DB, I know the DB should never be that big. Even more, one night I noticed that the DB has increased 30 GB where no obviously activity in the application happened. T