[Beginners Corner] - Re: jboss-dukes-bank app
by pepelara
Hi,
I was studying my web app and I have got the problem. It is in the class DefinitionTag that extends SimpleTagSupport. In the method,
| public void doTag() {
| try {
| getJspBody()
| .invoke(null);
|
| Definition definition = new Definition();
| PageContext context = (PageContext) getJspContext();
| setScreen(screenId);
| ArrayList params = (ArrayList) screens.get(this.screenId);
| Iterator ir = null;
|
| if (params != null) {
| ir = params.iterator();
|
| int cont = 0;
| while (ir.hasNext()){
| definition.setParam((Parameter) ir.next());
| cont ++;
| }
| Debug.println("DefinitionTag: params defined: " + cont);
|
| // put the definition in the page context
| context.setAttribute(definitionName, definition,
| PageContext.APPLICATION_SCOPE);
| } else {
| Debug.println("DefinitionTag: params are not defined.");
| }
| } catch (Exception ex) {
| ex.printStackTrace();
| }
| }
|
the line ArrayList params = (ArrayList) screens.get(this.screenId); returns null, so the rest of the code
| if (params != null) {
| ir = params.iterator();
|
| int cont = 0;
| while (ir.hasNext()){
| definition.setParam((Parameter) ir.next());
| cont ++;
| }
| Debug.println("DefinitionTag: params defined: " + cont);
|
| // put the definition in the page context
| context.setAttribute(definitionName, definition,
| PageContext.APPLICATION_SCOPE);
| } else {
| Debug.println("DefinitionTag: params are not defined.");
| }
|
returns, on the console, the message: "DefinitionTag: params are not defined." And it is because the value of this.screenId is,
"${requestScope['javax.servlet.forward.servlet_path']}"
that belong to screendefinitions.jspf as follow,
| <%@ taglib uri="SimpleTagLibrary" prefix="tt" %>
| <tt:definition name="bank" screen="${requestScope['javax.servlet.forward.servlet_path']}">
| <tt:screen screenId="/main">
| <tt:parameter name="title" value="Duke's Bank" direct="true"/>
| <tt:parameter name="banner" value="/template/banner.jsp" direct="false"/>
| <tt:parameter name="links" value="/template/links.jsp" direct="false"/>
| <tt:parameter name="body" value="/main.jsp" direct="false"/>
| </tt:screen>
|
| <tt:screen screenId="/transferAck">
| <tt:parameter name="title" direct="true">
| <jsp:attribute name="value" >
| <fmt:message key="TitleTransferSucceeded"/>
| </jsp:attribute>
| </tt:parameter>
| <tt:parameter name="banner" value="/template/banner.jsp" direct="false"/>
| <tt:parameter name="links" value="/template/links.jsp" direct="false"/>
| <tt:parameter name="body" value="/transferAck.jsp" direct="false"/>
| </tt:screen>
|
| <tt:screen screenId="/transferFunds">
| <tt:parameter name="title" direct="true">
| <jsp:attribute name="value" >
| <fmt:message key="TitleTransferFunds"/>
| </jsp:attribute>
| </tt:parameter>
| <tt:parameter name="banner" value="/template/banner.jsp" direct="false"/>
| <tt:parameter name="links" value="/template/links.jsp" direct="false"/>
| <tt:parameter name="body" value="/transferFunds.jsp" direct="false"/>
| </tt:screen>
|
| <tt:screen screenId="/atmAck">
| <tt:parameter name="title" direct="true">
| <jsp:attribute name="value" >
| <fmt:message key="TitleWDSucceeded"/>
| </jsp:attribute>
| </tt:parameter>
| <tt:parameter name="banner" value="/template/banner.jsp" direct="false"/>
| <tt:parameter name="links" value="/template/links.jsp" direct="false"/>
| <tt:parameter name="body" value="/atmAck.jsp" direct="false"/>
| </tt:screen>
|
| <tt:screen screenId="/atm">
| <tt:parameter name="title" direct="true">
| <jsp:attribute name="value" >
| <fmt:message key="TitleWD"/>
| </jsp:attribute>
| </tt:parameter>
| <tt:parameter name="banner" value="/template/banner.jsp" direct="false"/>
| <tt:parameter name="links" value="/template/links.jsp" direct="false"/>
| <tt:parameter name="body" value="/atm.jsp" direct="false"/>
| </tt:screen>
|
| <tt:screen screenId="/accountHist">
| <tt:parameter name="title" direct="true">
| <jsp:attribute name="value" >
| <fmt:message key="TitleAccountHistory"/>
| </jsp:attribute>
| </tt:parameter>
| <tt:parameter name="banner" value="/template/banner.jsp" direct="false"/>
| <tt:parameter name="links" value="/template/links.jsp" direct="false"/>
| <tt:parameter name="body" value="/accountHist.jsp" direct="false"/>
| </tt:screen>
|
| <tt:screen screenId="/accountList">
| <tt:parameter name="title" direct="true">
| <jsp:attribute name="value" >
| <fmt:message key="TitleAccountList"/>
| </jsp:attribute>
| </tt:parameter>
| <tt:parameter name="banner" value="/template/banner.jsp" direct="false"/>
| <tt:parameter name="links" value="/template/links.jsp" direct="false"/>
| <tt:parameter name="body" value="/accountList.jsp" direct="false"/>
| </tt:screen>
|
| <tt:screen screenId="/logoff">
| <tt:parameter name="title" direct="true">
| <jsp:attribute name="value" >
| <fmt:message key="TitleLogoff" />
| </jsp:attribute>
| </tt:parameter>
| <tt:parameter name="banner" value="/template/banner.jsp" direct="false"/>
| <tt:parameter name="links" value="/template/nolinks.jsp" direct="false"/>
| <tt:parameter name="body" value="/logoff.jsp" direct="false"/>
| </tt:screen>
| </tt:definition>
|
I think the value might to be "/main", "/transferFunds", etc...
and this is my problem.
Will you help me?
Merry Christmas,
Jose Alvarez de Lara(Oggie Svennson)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4198510#4198510
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4198510
15 years, 6 months
[JCA/JBoss] - Re: Changing XslUrl in XslSubDeployer
by makas
anonymous wrote : Why would you like to make the changes in the .xsl file?
When a -ds.xml is deployed, the XSLSubDeployer constucts MBeans.
createService() and init(DeploymentInfo) methods in this class transform -ds.xml into something like this
<service>
| <mbean ...>
| <depends ...>
| ...
| <mbean code="org.jboss.resource.connectionmanager.RARDeployment"
| display-name="ManagedConnectionFactory for ConnectionFactory SomeName"
| name="jboss.jca:service=ManagedConnectionFactory,name=SomeName">
| <attribute name="ManagedConnectionFactoryProperties">
| <properties>
| ...
| </properties>
| </attribute>
| <depends optional-attribute-name="OldRarDeployment">jboss.jca:service=RARDeployment,name=SomeName</depends>
| </mbean>
| ...
| </depends>
| </mbean>
| </service>
I want to add some changes to persist some attributes:
<service>
| <mbean ...>
| <depends ...>
| ...
| <mbean code="org.jboss.resource.connectionmanager.RARDeployment"
| display-name="ManagedConnectionFactory for ConnectionFactory SomeName"
| name="jboss.jca:service=ManagedConnectionFactory,name=SomeName"
| xmbean-dd="">
| <xmbean>
| <description>PersistentServiceExample</description>
| <descriptors>
| <persistence persistPolicy="OnUpdate"/>
| <persistence-manager value="org.jboss.mx.persistence.DelegatingPersistenceManager"/>
| </descriptors>
| <class>org.jboss.resource.connectionmanager.RARDeployment</class>
| <attribute access="read-write" getMethod="getManagedConnectionFactoryProperties
| setMethod="setManagedConnectionFactoryProperties">
| <name>ManagedConnectionFactoryProperties</name>
| <type>org.w3c.dom.Element</type>
| </attribute>
| </xmbean>
| <attribute name="ManagedConnectionFactoryProperties">
| <properties>
| ...
| </properties>
| </attribute>
| <depends optional-attribute-name="OldRarDeployment">jboss.jca:service=RARDeployment,name=SomeName</depends>
| </mbean>
| ...
| </depends>
| </mbean>
| </service>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4198509#4198509
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4198509
15 years, 6 months