Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!

Henry Sun

Greenhorn
+ Follow
since May 09, 2003
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 Henry Sun

Hi, Josh,
Thanks for your response. I am not sure whether this method can work. But actually I am working in a different senario. I am using Apache+JBoss servers and I have installed SSL into Apache server. I think your method may work if I install SSL into tomcat or jboss server, is it true? So in my senario, what I want is just getting a absolute path in ActionForwad(which should include https://). Do you have any any idea to resolve this problem with an easy way?
Thanks
henry
16 years ago
Hi, there,
I'm developing a website including http and https protocols. On my login page, I have a button which will call doSigninAction. In this action class, according to the result of authentication, I will get the ActionForward from struts-config.xml. My problem is, mapping.findForward() can only get the relative path which does not include http or https. But I need to forward my request from http to https in this action. How can I do it? I've searched in this forum, nobody seems giving answers for such question. I think Struts should have some mechanism to handle such cases. Any advice will be very helpful. It is urgent for me 'cause the project deadline is coming.
Thanks in advance.
henry
16 years ago
Hi, friends,
In my website, I need to go from http://mydomain/ to https://mydomain/. How to handle this case? I've tried to map an absolute path in struts-config.xml like this: <forward name="success" path="https://mydomain/"; /> but failed. Does anybody have such experience?
thanks.
henry
16 years ago
Hi, friends,
I have a page in which I must declare some beans in order to show read-only text and pictures in this page. When I submit the page, it goes into a form bean to execute validation. If any error occurs, struts will go back to the original page. But this time the beans(which have only request scope) do not exist any more. So the page display will go error. I don't want to put the beans into session. Does anyone have an idea on this case?
Thanks
henry
17 years ago
thanks for your reply. I have different submit button in the page. So there should be no problem for my issue. I'll test it this afternoon.
henry
17 years ago
Hi, friends,
I have a page which will perform multiple different functions in it, such as update product quantity, calculate shipping cost. Each function has its own form. I am wondering, can I use different ActionForms for the different forms on the same page and if any error, will the page display the error for the associated field on the associated form?
Thanks.
henry
17 years ago
Junilu, you are correct. Nested tag cannot resolve my problem. Just thinking to use one of the ways you mentioned.
Thanks a lot for all pastes.
Henry
17 years ago

Originally posted by Junilu Lacar:
The way the JSP parser works, you can't. You could try using JSTL-EL.


I think there should be a lot of cases like what I am doing. What are the other developers fixing this issue except using the JSTL?
thanks.
henry
17 years ago
Hi, friends,
In my jsp page, there is input like this: <input type="text" name="aName" value="<%= myBean.getMyProperty() %>" >
I want to rewrite it with struts tag as following:
<html:text property="aName" value="<bean:write name="myBean" property="myProperty" />" />. But the compiler always complains error. As long as I remove <bean:write> tag, it works. I am wondering can't I use one struts tag within another one?
thanks.
henry
17 years ago

Originally posted by Henry Sun:

In my bean, I am following the javabean rules for boolean property by defining the getter method like this: public boolean isPrimary(). But <html:equal> seems like to get any property by using exactly "public boolean getIsPrimary()". I've tested this way, it works. But is there any other way or tags to get it working?
Thanks your reply.
henry


Forget my last post. It works with your suggestion by <logic:equal name="myBean" property="primary">. I was still using "isPrimary" in the tag, so it doesn't work.
Thanks.
Henry
17 years ago

Originally posted by Junilu Lacar:
use the logic tag:
<logic:equal name="myBean" property="primary" value="true">
...
</logic:equal>


In my bean, I am following the javabean rules for boolean property by defining the getter method like this: public boolean isPrimary(). But <html:equal> seems like to get any property by using exactly "public boolean getIsPrimary()". I've tested this way, it works. But is there any other way or tags to get it working?
Thanks your reply.
henry
17 years ago
Hi, friends,
I have a bean with a boolean property "isPrimary" inside. I want to use it as a condition in my jsp page just like this:
<% if(myBean.isPrimary){
.... %>
My question is how can I replace this script by using struts tag, like <html:equal> or something else?
thanks.
henry
17 years ago
Hi,
I am writing a Java thin client in WSAD5 and testing with JUnit. Exception pops up when creating a context. The code is very simple:
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.ibm.websphere.naming.WsnInitialContextFactory");
env.put(Context.PROVIDER_URL, "corbaloc:iiop:localhost:2809");
initialContext = new InitialContext(env);
The exception message is:
junit.framework.AssertionFailedError: Exception in constructor: testFindCategory (java.lang.NoClassDefFoundError: com/ibm/CORBA/iiop/ObjectURL
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:140)
at com.ibm.websphere.naming.WsnInitialContextFactory.init_implClassCtor(WsnInitialContextFactory.java:168)
at com.ibm.websphere.naming.WsnInitialContextFactory.getInitialContext(WsnInitialContextFactory.java:108)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:662)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
at javax.naming.InitialContext.init(InitialContext.java:219)
at javax.naming.InitialContext.<init>(InitialContext.java:195)
at com.allmedia.domain.util.JNDIInstaller.<init>(JNDIInstaller.java:39)
at com.allmedia.domain.util.JNDIInstaller.getInstnce(JNDIInstaller.java:46)
at com.allmedia.domain.facade.CategoryFacadeTest.<init>(CategoryFacadeTest.java:29)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at junit.framework.TestSuite.addTestMethod(TestSuite.java:102)
at junit.framework.TestSuite.<init>(TestSuite.java:66)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.getTest(RemoteTestRunner.java:270)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:307)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:218)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:151)
)
at junit.framework.Assert.fail(Assert.java:51)
at junit.framework.TestSuite$1.runTest(TestSuite.java:225)
at junit.framework.TestCase.runBare(TestCase.java:140)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:131)
at junit.framework.TestSuite.runTest(TestSuite.java:173)
at junit.framework.TestSuite.run(TestSuite.java:168)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:329)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:218)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:151)
Can anyone help me figure it out?
Thanks!
henry
17 years ago
Hi,
I am developing in WSAD 5 and missing com.ibm.websphere.naming.WsnInitialContextFactory when looking up context. I want to add it in my classpath. Can anyone tell me which jar file it resides in?
Thanks.
17 years ago
sorry not yet. If you have any solution, please let me know, my email is henryhwsun@hotmail.com
thanks.
17 years ago