Win a copy of Kubernetes in Action this week in the Cloud/Virtualization forum!

E Robb

Ranch Hand
+ Follow
since Aug 27, 2010
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
5
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
(keep public parts private until JForum day)
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt
Moderation Tools

Recent posts by E Robb


Brilliant your a life saver! Im so new to xsl I didnt know where to begin! This give me a great overview, works a treat and I can modify it for a more complicated XML structure.

Thank You!

Paul Clapham wrote:Well, displaying the XSLT code as a concatenation of Java strings is kind of an odd thing to do, but as far as I can see you've already done what I suggested. There's what looks like the identity transformation at the beginning, and then there's a template which does something with elements which look like <Items type="INOUT">. So that's a good start.

Now, your problem is that you want to drop some <Item> elements which satisfy some condition? Then you write another template which matches <Item> elements. If the element satisifes the condition, then write out the element and inside it you do xsl:apply-templates.

And if I were you I would put that XSLT code into its own file, rather than mixing it up with Java code like that. Easier to maintain, especially having to make sure you do the quotes and apostrophes right.



Your first paragraph is correct. I should not be doing strings like that. Jeeze I feel like boozo the clown.

OK can do a xsl:template match but how do I delete? "PayBill entityid="142232"" doesnt equal "Option id="142672"" so Parent of PayBill entity <Item entityid="230138"> and its children need to be removed from the xml.

Sorry Im really a newbie to XSL.

Paul Clapham wrote:When your requirements say "I want the output to look just like the input except..." then your starting point is an identity transformation. Then add templates which do the specific modifications you're interested in.



Hi Paul,

I have a template for upper level sortling of dates in the xml which goes something like this. I would like to incorporate the transformation based on comparing two properties but I dont have a clue as to how to incoprorate it.




Can you elaborate more on how I can compare one properties elements to another properties elements and eliminate anything that does match as I mentioned my original post. Heck I would be happy on terms to google to accomplish the structure from my original post.

Thanks

Tiya Khambadkone wrote:Do you know any tool to transform XML to another XML using XSLT ?



Ive been working with XML Copy Editor by source forge for testing transformations before setting up the programming. http://xml-copy-editor.sourceforge.net/
I've been working with XSL a little and can do simple things but this I have no idea where to begin.

Anything that does not match the Option ID in Options I would like removed from PayBill entityid.

Abbreviated XML original Structure:



Code that I would like to achive with XSL transform



Would greatly appreciate a nudge in the right direction
Well yes I understand how to use "exploded WAR" and the server set up. There is no issue there.

My question is, is there any way work with Eclipse and have it not create a compressed war. The issue here is everytime I want to see a jsp change eclipse deploys a compressed war to my jboss deploy directory. Which is all fine and dandy but it eats up my JVM and causes perm gen errors.

It would be helpful if there was some way I could work out of an uncompressed directory in eclipse so jsp changes would be seen by both eclipse and jboss without having to redeploy a compressed war. Because of Eclipses directory structure I dont see any logical way of doing that.

Im probably missing something simple here but do you redeploy a compressed war for every little jsp change you make? lets say in eclipse on a jsp I want to change <i>italics</i> to <b>bold</b> do you then redeploy the entire compressed war just to see that one text change?

Thanks for the help.

Earl
I am using Eclipse and Jboss 4.2. I would like eclipse to create an uncompressed war that jboss can read so every time I update a jsp a new compressed war does not need to be deployed to jboss for me to see the changes.

Does anyone have any good links on hot deployment & Eclipse? I have been googling for hours and dont see any information on how to make eclipse use an uncompressed war.

I see some information on symbolic links and MKlink /j but dont fully understand the deployment strategy.

Thanks,
Earl
Hi All,
I have some pages that are very simple and dont need actionsupport to use execute or prepare. Those pages I think creating a java file would be overkill so I just use a bean and grab what I need. I have noticed that the stack trace shows messages such as:

The default value expression '/login/login' was evaluated and did not match a property. The literal value '/login/login' will be used.

It appears to me that any page I have mapped that I dont have an action for throws an error. Its not a fatal error but its logged. Is there any way to tell the struts that just because I have mapped an extension such as .html or .jsp it doesnt neccessarly mean I have an action for it?

Thanks,
Earl
6 years ago

Jayant Kaushal wrote:
when will we use FilterDispatcher and when StrutsPrepareAndExecuteFilter.
i read that FilterDispatcher is being depreciated.Can someone shed some light.
Thanks in advance.



My understanding is the difference between FilterDispatcher & org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter has to do with the version of struts.

earl
6 years ago
Can you join cssClass of style sheets in struts using cssClass?

In html/css I can call class="listMenus ListMenusButtonWidth" which calls the two style sheets listed. When I try and use struts cssClass="listMenus ListMenusButtonWidth" It breaks the css.

Is there any way to use cssClass to call two style sheets?

Thanks,
Earl
6 years ago
I have tried all of these none of them work. I would like the current locale from the stack in a <s:property tag.

It seems like it should be so simple but the only place I see the locale on the stack is in.

com.opensymphony.xwork2.ActionContext.locale en_US

this is the local555 = <s:property value="#request.locale"/><BR>
TEXT IS MY NAMEthe local555 = <s:text name="%{#request.locale}"/><BR>
this is the local5222 = <s:property value="#attr.locale"/><BR>
Another is the local500 = <s:property value="%{#attr.locale}"/><BR><br>
</br>
<s:property value="#request"/><br><br>

<s:text name="LBL_SECURITY_FORGOT_PWD_N">
<s:param value="%{request_locale}"/>
</s:text><br>

<s:set name="thisLocale" value="%{#request_locale}"/>
From the Set Locale=<s:property value="#thisLocale"/> <br>

<br></br><br>
try the session <s:property value="#session.WW_TRANS_I18N_LOCALE"/>
6 years ago
I know how to get sessions with OGNL <s:property value="#session.myValue"/>

Is there any way to set a session value and header value?

I am assuming to set a session value you would use something like this.
<s:set name="sessionName" value="SessionValue" scope="session" />

This could then be retrieve that value in any page during a session with a scriptlet something like this:
<%
out.print( (String)session.getAttribute("sessionName") );
<%


Assuming this is correct is there something similar I could use in OGNL to say set response headers similar to:
response.setHeader("Pragma", "No-cache");
response.setHeader("Cache-Control", "no-cache");
response.setDateHeader("Expires", -1);

Thanks,
Earl

6 years ago
I have a s:iterator that that is calling a POJO. I dont want the values printed out to screen I want them stored and used in a s:label value.

Is it possible and is the correct approach? I am working with the simple xhtml theme on a non form. Im just trying to print out a table.

Create the objects:



The POJO returns a hashmap with this call:


This simple table works correctly as struts is using s:label to insert the tr and td tags.


The html it is rendered like this:


My problem is this... one of the calls to the control label value needs to use an iterator to call a second method to get multiple data points to display in the same control value. Its should look like this when rendered.


I need this iterator:


Instead of printing out the iterators data to directly to the the JSP page is there a way to run the iterator and place the results in the s:label value?

Any help would be appreciated.

thanks,
earl
6 years ago
This works for retrieving individual values from the HashMap that is in the struts s:set tag


earl
6 years ago
I am using a bean to call a class. Its not an action class just a simple class. The class returns a HashMap which I am putting into a struts s:set. The hashmap is definately in the s:set but I cannot retrieve individual values.

My question is how do I retrieve an individual value from the HashMap in s:set?

Here is the Code:



If I try and retrieve individual values from HashMap in s:set nothing is returned:




I Know that the values are in s:set because the following code iterates through the HashMap returning all the values:



Returns:


Cant figure out how to retrieve an individual value from the HashMap stored in s:set

Any help would be apprecited.

Thanks,
earl
6 years ago