Win a copy of liveProject: Protecting User Data with Spring Security and OAuth2 this week in the Spring forum!

Joe Shy

Ranch Hand
+ Follow
since Dec 09, 2005
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Joe Shy

Wow, thank you so much. I looked all over thinking it was something that simple. However, I didn't really think it was on the bean side. Works great.

Thanks again,
Cheers
Joe
13 years ago
I apologize, this may not be the place for this question, but I am in the process of doing a struts tutorial and thought it might fit here. Basically, I am formatting a string to be used in a bean that my jsp page will <bean:write../> with. In my action page, i have the code below. The page loads and runs fine, I thought the <br> would cause a new line in the html.



However I get the following in the html:

Hello Mr. YOUR LAST NAME at:
1234 Near Ave<br>New Town, US<br>12345

Looking at the html source I get:
Hello Mr. YOUR LAST NAME at: <br>
1234 Near Ave&_lt;br&_gt;New Town, US&_lt;br&_gt;12345

I know that browsers won't interpret the white space and I tried using \n and \r\n to see if I would get lucky, but I can't seem to find out the trick. I also tried xml's <![CDATA[<br>]]> to see how the browser would handle it.

Is there something going on internally that is changing the < to &_lt; and > to &_gt;?

I am using NetBeansIDE 5.5.1 with jdk 1.5.0_11.

EDIT: The underscores in the &_gt; are not really there, just there to show that I am not getting < in the code.

Thank you for the help,
Joe

[ June 22, 2007: Message edited by: Joe Shy ]
[ June 22, 2007: Message edited by: Joe Shy ]
13 years ago
Kimberly,

If you have your WSDL already apache axis has an app that you can use called WSDL2Java to create some of the java.

[URL= http://ws.apache.org/axis/java/user-guide.html#WSDL2JavaBuildingStubsSkeletonsAndDataTypesFromWSDL ]Apache Doc on WSDL2Java[/url]
14 years ago
You may want to add to your CLASSPATH also your %JAVA_HOME%;. based on the paths you posted above. This should already be set though since you have the JDK installed.

If you search your jdk dir do you find the tools.jar? If not you may need to re-install java 5.0 (1.5)

Joe
14 years ago
Thanks for the responses. I have "axis" (don't know why I put access) setup. I have my own web services running. The vendor I'm working with is going to setup a test site for me to use with a new wsdl. So i don't have to deploy it locally. I guess what I was trying to do was get a web service from modifying the WSDL to run locally from axis. The WSDL2Java made me think I might be able to do. I didn't see an xxxximpl.java, but I also didn't install the admin part.

Thanks again,

Joe
14 years ago
The answer to this question might be as simple as a no, but I wanted to make sure. With apache access is there a way to deploy a web service with just the WSDL. I did the WSDL2Java, but I need to set up a test server @localhost. The java files that came back where quite extensive and I don't really want to pour through all the code.

Any help is appreciated.

Joe
14 years ago
Do you just have the 1.5 jre or the sdk/jdk too?

C:\jdk1.5.0_07\lib is were my tools.jar resides, but it looks like you have the default install.

As a rule JAVA_HOME= BASE_JAVA_DIR(C:\jdk1.5.0_07 in my case).
14 years ago
I guess I chose Vector since I can start with the initial size of 10 and then do .addElement() and it increases the size by one. I do this because the total capacity could be 1 or 100, never more than 1000. I don't want to reserve 100 arrays with 1000 entries to ensure capacity. I wouldn't be surprised if I am missing something though.

I do like the idea of the wrapper class with two maps. I haven't had much time to work on this today, but will keep plugging away.

Thanks always,
Joe
14 years ago
Thanks for the code. You are correct, this is for work and not homework. However, I am seeing that the code requires Java 5.0. I think I can work with it to make it work with 1.4.2, and post my results. Thanks again for the head start.

14 years ago
Thank you for the response, I think I see what you mean, but I have to work with the Map.Entry some more.
14 years ago
I am working on sorting a list of alpha numerics. No big deal, or so I thought. I have to filter out unique keys and sort on the alpha numberic column. I brought them in using a Hashtable and Set. That allowed me to pull the related values under there duplicate key. Then I pulled out the non duplicate values into a vector and do Collections.sort(<Vector> ; . It sorts them just fine. Now I need to find the hash key that macthes the value to update the DB order. The hash table doesn't return the key value on any of the get() or contains() methods listed in the API. Anyone have an idea on how to do this? I thought about creating objects, but then after sorting run into the same problem. I didn't paste the code yet, but can if someone would like to see it. I am trying to avoid writing my own sort, since the Collections.sort part suites my needs.

Simple example
Key1 Value3
Key2 Value1
Key3 Value2

Vector: Value3, Value1,Value2
Sort...
Value 1, Value2, Value3
Get Key from value???

Thanks for the help,
Joe
14 years ago
I agree, it does sound like a classpath issue, but I have seen this since you can't actually instantiate the SaxParserFactory.

Have to do something like SAXParserFactory factory = SAXParerFactory.newInstance();

Hope that helps, if not I would post the JDK and classpath.

Cheers,

Joe
I figured out how to Validate with Java 1.4.2 and SAX(2.0). I had to download the new SAX jars from sun, place them in the jre, and used the following.



Forgot: If the file isn't valid and the void error(SAXException e) { } isn't overidden, then the file parses with the errors in it and you'll never know.

Thanks for the help in leading me in the right direction.



Joe
[ February 10, 2006: Message edited by: Joe Quickshot ]
I tried using that process from IBM and it didn't produce anything different. I made sure I matched the process and nothing. I even went and downloaded the latest jdk and jaxp. It isn't a huge issue, but the users that will possibly edit the xml file won't have a way to validate (or know how), that is why I was looking into this. If there is another solution, I would be open to exploring it.

Thanks for the help,
Joe

You could try using a pattern instead of an enumeration. That would let you provide a regular expression.



That is what I would use also, the <pattern> element recognizes regular expressions. that way you will only get your yes/no and its permutations.

Cheers.