sam jsem

Greenhorn
+ Follow
since Mar 12, 2011
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by sam jsem

All,

I am having the following problem in Struts2: I have an ModelDriven Action. In that Action, ActionA I am preparing an object, ObjectA, for display. However, this is a complex object: ObjectA has as a properties List<ObjectB>. When the ActionA's execute method has completed, I display certain String properties of ObjectA in a JSP. I then iterate over ObjectA's List<ObjectB> also in the same JSP. What follows is the code for the iteration I conduc



The issue is that the radio button is not rendering or passing the value I want properly. I want the 'id' property in ObjectB in the iterator to contain the ObjectB's 'emailAddress' value. This value should then be subseqently passed to other actions. Could someone please help to explain why it is not rendering correctly, and what the right answer is to get it to render correctly? Any help would be greatly appreciated.

The definition of ObjectA and ObjectB is as follows:


11 years ago
Hi all.

I am using Struts 2.2.1; and, I have the following concern: I have an object A which has reference to three other objects: B, C, D. In my JSP I make reference to properties in all A, B, C and D. I call an action which implements the ModelDriven Interface.







However, the only properties that gets populated are the simple properties of A. I was under the impression that ModelDriven would populate the entire object graph for you, namely, all the properties of A, B, C and D. I have tested various notation in my JSP including:

Parent.Child.Property



Child.Property



Property



No luck. I believe that it is possible to populate an object graph based on ModelDriven. Am I correct in thinking this? Could you please offer some advice if I am correct in thinking this?

Thanks.
13 years ago
Lucas,

Thanks again for your timely assistance.

Since we have a similar implementation, I thought I might share with the fruits of my two days of excruciating labour: Struts 2 jQuery Plugin Showcase. It appears as though there is a plugin for Tiny MCE. I was able to success deploy it into my application; furthermore, there are also lots of other goodies.

Thanks again for all your help. Cheers.
13 years ago
I am certain that the file directory path is: '%APPLICATION_CONTEXT_ROOT/commons/tiny_mce/tiny_mce.js'. I am really puzzled as to what to do now.

Would you mind sharing the 'head' section of your HTML document?

Thanks.
13 years ago
Lucas:

Thanks for you response. I tried you suggestion as in the code below. Unfortunately: No luck. The odd striking phenomenon here is that when I look at the source code for Firefox and click on the associated values from the 'src' element, they will generate the Javascript or CSS, including the CSS I am using. However, when I click on the link associated with the 'src=/ApplicationName/commons/tiny_mce/tiny_mce.js', I get a HTML 404 page.

Here is what I introduced in my Java code as per your suggestion:



Here is what was generated by the browsers:



I tried to add the Javascript code to the tile with the HTML 'head' element, and in the tile that includes all the content. But both times there were no errors that IE7 and Firefox 3.6 recognized, but they would not render the Tiny MCE WYSIWYG editor for textareas.

Do you think the issue is that as a consequence of my Java code, the browser, app. server, or whatever cannot find the 'tiny_mce.js' file? Is it because the browser cannot resolve the link: ''.

When I copy and paste the code from the browser view source window into a test HTML file, and I run that file, the Tiny MCE WYSIWYG editor appears no problem. Also, when I view the source of my test HTML file, the link that points to the 'tiny_mce.js' file generates the file no problem. But when I run that page as part of my Web application on WebLogic, it does not resolve the link that should be point to the file 'tiny_mce.js'; and it does not render the Tiny MCE WYSIWYG editor. Any thoughts?

Thanks
13 years ago
Hi.

I am using Struts 2.2.1 with Tiles. I am encountering the following issue: In my tile with the HTML 'head' section I declare some Javascript to invoke the TinyMCE WYSIWYG editor for HTML 'textareas' (please see below); however, when I run the application the Javascript that should invoke the TinyMCE WYSIWYG does not execute. Consequently, the TinyMCE WYSIWYG is never rendered.

When I test the application in IE 7, the page renders just fine with textareas, but I do not see the WYSIWYG options of Tiny MCE. A more telling illustration comes for Firefox 3.6. When I view the source of the HTML that is generated, I see the following:



I am able to the click on the 'src' and 'href' elements of the page in the Firefox view source window and actually see the generated 'struts_dojo.js' and my 'ApplicationName.css' file, but when I click on the key element 'src' and value '/ApplicationName/commons/tiny_mce/tiny_mce.js' associated with it, I get a HTML 404 listing.

I have copied the code from the IE and Firefox view source window, and pasted it into an test HTML file. When I launch this HTML file and view the source from Firefox for the key element 'src' and value '/ApplicationName/commons/tiny_mce/tiny_mce.js' I can actually see the Javascript. Also, the Tiny MCE WYSIWYG editor renders fine. I was hoping someone could help me understand why this is the case, and how I can get my Struts 2 application to render the Tiny MCE Javascript code. I include what I believe is the code necessary to understand my setup.

Struts 2:

I am using the 'simple' UI theme as we construct our own CSS / HTML layout. In my 'struts.properties' file I include the following line:



The relevant sections of my 'web.xml' file:



Here is the code from my tile which includes the HTML 'head' element.



Note in the line , I have also tried which appends the jsessionid to the end of the generated value for HTML element 'src', and . Neither of these seem to help, so I ended up trying to add the relative URI to the value of the 'src' element as above.

Does anyone have any suggestions as to why the 'tiny_mce.js' file is not being called? If there are any details I have left out, please let me know.

Thanks.
13 years ago
I have noticed some confusion regarding how to create a single radio button using Strut (2.2.1) and deploying it in a DisplayTag (1.2) table. I was able to figure out one solution, so I thought I may take the time to share my results. Hopefully I am doing it the recommended way; if not: Please advise as to the recommend approach.

I have implemented the PaginatedList interface packaged with Displaytag. I save the implementation of the PaginatedList interface in session after I have populated the java.util.List implementation from my datasource. In my JSP, I use the following code to render one radio button that is associated with one row in an HTML table rendered by Displaytag:



This will display the following rows of HTML (using a little imagination): Assuming that the '*' is the radio button; and 'Wilson' refers to the 'fname' column.

* | Cuddy
* | Baar
* | Khan
* | Parmar

Here is the partial HTML source for the radio button:

<td><input type="radio" name="ckey" id="ckey" value="206059"/><label for="id"> </label></td>

Hope this helps someone out there.
13 years ago
Dear all:

I have a question regarding Struts 2.2.1 and DisplayTag's 1.2. PaginatedList Interface: Why does it not display the results of the partial list? Here are all the necessary details below:

Test.jsp
The following DisplayTag code is in my JSP:



Struts 2 Action's relevant code
In my execute: I go and get data necessary to populate the PartialList implementation.



The above code returns nothing on the display JSP. However, I do have scriplets embedded in the JSP and I can see that the session object 'page' is there, along with the java.util.List which is part of the 'page' object graph. Oddly enough: When I put the 'name' attribute of the 'table' element in the OGNL, , the page returned contains a 'toString()' of the PartialList implementation: PageImpl. I get something like the following when I view the source in my JSP:



However, as you can see, the other two OGNL expressions resolved just fine: ; .

I have read over the documentation, and looked and tried every sort of example on the Web. Can anyone please explain this weird behaviour as I am under heavy time constraints? What am I doing wrong?
13 years ago
Dear all,

I have a very simple Struts 2 application I am attempting to deploy to Weblogic 10.3.3. It has no Web Services component to it all. However I seem to getting the following error: "Can't find wsdl /wsdls/wsc11/wstx-wscoor-1.1-wsdl-200702.wsdl".

--------------------------------------------------------------------------------

Here is my web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5">

<display-name>FHEO Portal</display-name>

<context-param>
<param-name>org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG</param-name>
<param-value>/WEB-INF/tiles.xml</param-value>
</context-param>

<listener>
<listener-class>org.apache.struts2.tiles.StrutsTilesListener</listener-class>
</listener>

<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>


<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>

--------------------------------------------------------------------------------

Here is my struts configuration file: struts.xml

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd">

<struts>

<constant name="struts.enable.DynamicMethodInvocation" value="false" />
<constant name="struts.devMode" value="false" />
<!--
-->

<package name="SCHO" extends="tiles-default">
<result-types>
<result-type name="tiles" class="org.apache.struts2.views.tiles.TilesResult" default="true"/>
</result-types>

<action name="FlashPage">
<result>flashPage.jsp</result>
</action>
</package>

</struts>

--------------------------------------------------------------------------------

I am the following error when I try to deploy a test build of my application to Weblogic 10.3.3.0:

Can't find wsdl /wsdls/wsc11/wstx-wscoor-1.1-wsdl-200702.wsdl

at weblogic.wsee.deploy.WSEEModule.prepare(WSEEModule.java:146)
at weblogic.wsee.deploy.AppDeploymentExtensionFactory.prepare(AppDeploymentExtensionFactory.java:147)
at weblogic.wsee.deploy.AppDeploymentExtensionFactory.access$100(AppDeploymentExtensionFactory.java:27)
at weblogic.wsee.deploy.AppDeploymentExtensionFactory$1.prepare(AppDeploymentExtensionFactory.java:427)
at weblogic.application.internal.flow.AppDeploymentExtensionFlow.prepare(AppDeploymentExtensionFlow.java:23)
at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:1223)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:367)
at weblogic.application.internal.SingleModuleDeployment.prepare(SingleModuleDeployment.java:43)
at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:154)
at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:60)
at weblogic.deploy.internal.targetserver.operations.ActivateOperation.createAndPrepareContainer(ActivateOperation.java:208)
at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doPrepare(ActivateOperation.java:98)
at weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperation.java:217)
at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(DeploymentManager.java:749)
at weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(DeploymentManager.java:1216)
at weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(DeploymentManager.java:250)
at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(DeploymentServiceDispatcher.java:160)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doPrepareCallback(DeploymentReceiverCallbackDeliverer.java:171)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$000(DeploymentReceiverCallbackDeliverer.java:13)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$1.run(DeploymentReceiverCallbackDeliverer.java:47)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)


--------------------------------------------------------------------------------

As I said: there is no Web Services component to this application. It is very simple deployment on Weblogic, yet I am getting this inscrutable error. Could someone please offer some advice regarding this issue?

13 years ago