sandy gupta

Ranch Hand
+ Follow
since Jan 30, 2001
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by sandy gupta

It does survive and it is a dash character. It shows up well on the windows 1252 encoding which your browser sets. But try changing the encoding on the browser to utf 8 and you will realize what i am talking bout.

BTW, I realized that the culprit was my java application which is using the US-ASCII charset on the unix box. I have tried everything from using readers instead of streams to using the string api to change the charset encoding but it seems like nothing is working.

If anyone has any idea of how you can force stuff in java to follow a particular encoding, please do let me know.
18 years ago
I have tried doing that and it does not help
18 years ago
I am having this really weird issue on Unix where some of the characters coming from Windows CMS (where else) are showing up as a ?
These characters are not normal in the sense that i can see that the bytecode assigned to these is really messed up.
Has anyone faced this issue earlier. If so, how do you go about solving this issue.

Here are the details.
I am using
//Get the input stream

To get the input stream from a web file and then downloading it as an html file on the stream translates the weird character into a ?

Byte:100-->Char -->HexCode:4
Byte:111-->Char -->HexCode:F
Byte:32-->Char: -->HexCode:0
Byte:32-->Char: -->HexCode:0
Byte:111-->Char -->HexCode:F
Byte:32-->Char: -->HexCode:0

Notice the byte value of -106 on that character. I have tried using readers setting the charset encoding to iso-8859-1 as well as utf8 but both gave the same results.

I am currently running out of options so please help.

18 years ago

I am trying to pass multiple values through a hidden variable on a form post but am not getting the values in my form bean. What am i doing wrong?


<html:hidden property="svalues" value="abc, def"/>


private String []svalues = null;

public String []getSvalues(){
return svalues;

public void setSvalues(String []values){
svalues = values;

19 years ago
I am about to start a project which requires a load of configuration information to be loaded on startup. I was thinking of using a Plug-In to load the information into these classes by parsing the xml configuration file. Much like what struts does in the framework for the struts-config.xml
What do the experts feel? Does anyone have any experience with this kinda set up? Are there any pitfalls/advantages to it? Any input is appreciated.

19 years ago
A neat way of doing this using struts is to submit the action to an intermediate servlet(action class) where all you do is to populate the second list based on the value of the first and then return to the original page. If you keep the action bean scope=session, then rest of the session information is mainatained and struts will auto-populate the values in all the other fields on the page. I have done this and it works. This is strictly to avoid scripting in client browsers which is a definate no-no for my project.
19 years ago
I am using sourceforges WebTestCase, from the jwebunit package. Now my problem is that when i try to run the tests(compiling is fine), i get a very weird error.
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at com.meterware.httpunit.parsing.NekoHTMLParser.parse(NekoHTMLParser.ja
at com.meterware.httpunit.HTMLPage.parse(
at com.meterware.httpunit.WebResponse.getReceivedPage(
at com.meterware.httpunit.WebResponse$Scriptable.load(
at com.meterware.httpunit.javascript.JavaScript$Window.initialize(JavaSc
at com.meterware.httpunit.javascript.JavaScriptEngineFactory.associate(J
at com.meterware.httpunit.FrameHolder.<init>(
at com.meterware.httpunit.WebWindow.<init>(
at com.meterware.httpunit.WebClient.<init>(
at com.meterware.httpunit.WebConversation.<init>(
at net.sourceforge.jwebunit.TestContext.getWebClient(
at net.sourceforge.jwebunit.HttpUnitDialog.initWebClient(HttpUnitDialog.
at net.sourceforge.jwebunit.HttpUnitDialog.<init>(
at net.sourceforge.jwebunit.WebTester.beginAt(
at net.sourceforge.jwebunit.WebTestCase.beginAt(
at com.mws.tests.TestSendMessageJsp.testUnSuccessfulMessage3(TestS
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at junit.framework.TestCase.runTest(
at junit.framework.TestCase.runBare(
at junit.framework.TestResult$1.protect(
at junit.framework.TestResult.runProtected(
at junit.framework.TestSuite.runTest(
at junit.swingui.TestRunner$

This exception is being thrown for all my test cases. I am not able to figure out why this is happening. I have all the classes that are needed in the classpath. It does not seem like a classpath issue to me. Yet.
Please let me know if this is a known issue or if someone has resolved this problem in the past. Looking fwd to a response from your side.
19 years ago
Your application resources properties file needs to be defined in your struts-config.xml. Did you do that.
20 years ago
Make an action that gets the data from wherever and then populates the formbean with the data and then send to the jsp page that you are trying to load and when the jsp loads, the formbean data can be loaded.
Lemme know if its still confusing
20 years ago
Shouldnt your struts-config.xml and web.xml be in the web-inf dir
20 years ago
What is it that we are doing here exactly? Can you be more detailed about it.
20 years ago
u could use jstl like this
<c:set var="speclist" value="${applicationScope.profileCache.professionSpecialtyListMap}"/>
<c:forEach var="entry" items="${speclist}">
<c:if test='${entry.key == prof}'>
<select name="specialty" class="text10">
<option value="">---------- Select One ----------</option>
<c:forEach var="specialty" items="${entry.value}">
<c:set var="specid" value="${specialty.specialtyID}"/>
<c:set var="name" value="${specialty.description}"/>
<option value="<c ut value="${specid}"/>" <c:if test='${specid == spec}'> selected </c:if> ><c ut value="${name}"/></option>
and java script should be fine but why would it cause the form to submit unless u are using an html:img tag........i had a problem when i was using html:img buttons initially coz i was accidentally calling the form on the click of the image.............make sure that its not the same thing....
20 years ago
Hey Sumit,
This is absolutely possible. You have to understand that the dynavalidatorform is a form bean which is used to store the information being transferred betn server and client and the action is the controller which controls the application flow so there is no reason that one can not be mixed with the other.
DispatchAction is an action class that uses method names for choosing which method to execute (selective execution) but the validation fwk uses the path specified in the struts-config.xml to validate irrespective of the action class and the method name used.
So you should definately be able to use it.
Let me know if you have problems doing this.
20 years ago
if your jsp1 uses the same form bean as jsp2 and your scope of the bean is set to session, then you should see this automatically. if this is not true, then you have to set the jsp2's form bean with the value from the jsp1's form bean in your action to which jsp1 posts explicitly before sending to the jsp2.
20 years ago
Simple solution
Make a class and put this in your web.xml
Note the load-on-startup tag which tells the server, the priority loading order of this servlet. In the init of this class, you can load your objects and store them in some context avl to all applications (appcontext).
I have this set up on both wl8 and tomcat4.1
20 years ago