giang nguyen

Ranch Hand
+ Follow
since May 13, 2003
Merit badge: grant badges
For More
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 giang nguyen

In WSAD 5.0, I can associate a html error code (for example 500 or 404) with a error.jsp page and it run well whenever such error code return. But when I deploy on WAS 5.0 the server always return the urgly html default error message. I don't understand why.
<error-page>
<error-code>404</error-code>
<location>/pages/filenotfound.jsp</location>
</error-page>
This code run well on WSAD but cannot on WAS.
Can any body ever configure such pages on WAS 5.0 please help

Thanks
19 years ago
Thanks for your question.
The reason I need to call a servlet from jacl command is that: I have another independent programm running and needs to notify my web application of some important events. That program will run the jacl script file to do this.
I am just learning jacl. As I understand, jacl command can call methods on any object in the same jvm. If so, I need to know the web container object name and the appropriate method to call. Or more simple, can the jacl send a http request to the web container?
Anther simple solution would be to use a static flag and jacl script can set this flag. My web application will check this flag every time a new request come and decide on the action depending on the value of the flag
.......
I Hope to receive an advice from you.
Thanks
19 years ago
Hi every one,

Do you have any idea on how we can run a jacl command script to call a WAS web container http intercepter method?
I am new to jacl and websphere admin and now I need to call a servlet from a jacl command.
Thanks in advance
19 years ago
I am using WAS 5.0 and need to upload image to a folder under WebContent. I use strut upload form and now need to write uploaded image . How can I know from the context of a servlet the absolute directory path of my web application so that I can save the image file to the right destination? I have to save the images to webcontent because I will need to show it again in my webpage.
Thanks
19 years ago
Yes, I have the same problem. Can any one explain ?
19 years ago

Originally posted by Kyle Brown:
It will not work. The same registry must be used across all the servers and nodes in the cell. That's just the way the product is designed.

Kyle



Thanks very much Kyle.
BTW, do you know how to get more information from the websphere internal servlet that handle security? I need a custom error page that display information about the failed user. For example "Your account is blocked after 3 successive login failure". At present, I find no way to get more information about the status of user, only success or failure.
19 years ago
You can only send a redirect to a resource in another web application. Forward is impossible. Servlet container will not maintain attributes stored in the request from one web app to another.
To do a sendRedirect, add the context root to the url.
for example: ../yourContextRoot/servlet2
19 years ago

Originally posted by lee anthony:
hi
i was trying pull connectio pooling features
by replacing
<data-source type="org.apache.struts.legacy.GenericDataSource">
with
<data-source type="org.apache.commons.dbcp.BasicDataSource">
in my struts config xml
=========Struts-config.xml=================
my datasource looks somthing like...
<!-- <data-source type="org.apache.struts.legacy.GenericDataSource">==================================== Data Source Configuration -->
<!-- ==================================== Data Source Configuration -->
<!-- <data-source type="org.apache.commons.dbcp.BasicDataSource">==================================== Data Source Configuration -->
<data-sources>
<data-source type="org.apache.commons.dbcp.BasicDataSource">
<set-property property="autoCommit"
value="false"/>
<set-property property="description"
value="eProject Data Source Configuration"/>
<set-property property="driverClass"
value="org.postgresql.Driver"/>
<set-property property="maxCount"
value="1000"/>
<set-property property="minCount"
value="1"/>
<set-property property="password"
value="test"/>
<set-property property="url"
value="jdbc ostgresql://192.168.1.202/ep"/>
<set-property property="user"
value="pguser"/>
</data-source>

</data-sources>
But while in running my tomcat server it throw a exception....
<!-- <data-source type="org.apache.struts.legacy.GenericDataSource">==================================== Data Source Configuration -->
<!-- ==================================== Data Source Configuration -->
<!-- <data-source type="org.apache.commons.dbcp.BasicDataSource">==================================== Data Source Configuration -->
<data-sources>
<data-source type="org.apache.commons.dbcp.BasicDataSource">
<set-property property="autoCommit"
value="false"/>
<set-property property="description"
value="eProject Data Source Configuration"/>
<set-property property="driverClass"
value="org.postgresql.Driver"/>
<set-property property="maxCount"
value="1000"/>
<set-property property="minCount"
value="1"/>
<set-property property="password"
value="test"/>
<set-property property="url"
value="jdbc ostgresql://192.168.1.202/ep"/>
<set-property property="user"
value="pguser"/>
</data-source>
</data-sources>
============Error from Tomcat=========
SEVERE: Initializing application data source org.apache.struts.action.DATA_SOURCE
org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'jdbc ostgresql://192.168.1.202/ep', cause:
java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getDriver(DriverManager.java:243)
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:743)
at org.apache.commons.dbcp.BasicDataSource.setLogWriter(BasicDataSource.java:576)
at org.apache.struts.action.ActionServlet.initModuleDataSources(ActionServlet.java:1087)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:472)
at javax.servlet.GenericServlet.init(GenericServlet.java:256)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1044)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:887)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3948)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4271)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1125)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:816)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1125)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:518)
at org.apache.catalina.core.StandardService.start(StandardService.java:519)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:2343)
at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
======================================
Can anybody help me ...or advice me a better way for including connection pooling features Thanks ..do help
Lee


What Application server do you use? You should use the connection pooling support from Application server. Configure a datasource and a connection pool in server and your application can use the pool. This way is much better than using connection pooling from Struts which should be used only if your application server does not support connection pooling.
19 years ago
Hi,
I am using WAS 5.0 and write a custom user registry for my own EAR file. But the problem is, with one installation of WAS, all other EAR applications installed will have to share this user registry implementation if they are to use standard J2EE security.
This cause a lot of trouble for me because my user registry implementation have to take into account the security for Admin console and any other EAR file using standard J2EE security.
Does any of you know how to configure WAS so that user registry for different node or server can be different too.
Many thanks
19 years ago
Hi,
I am using WAS 5.0 and write a custom user registry for my own EAR file. But the problem is, with one installation of WAS, all other EAR applications installed will have to share this user registry implementation if they are to use standard J2EE security.
This cause a lot of trouble for me because my user registry implementation have to take into account the security for Admin console and any other EAR file using standard J2EE security.
Does any of you know how to configure WAS so that user registry for different node or server can be different too.
Many thanks
19 years ago

Originally posted by manish kkum:
We are using Struts bean tag to fetch collection of values from a Action form and displaying these values in a JSP through logic:iterate tag. When we try to render the JSP page, it gives "No getter method found for" values (collection type) as a servlet exception. This problem comes only in case of for collection of values. We are using WSAD 5.1.1.
The real weird part of the problems is that when we use WSAD 5.1.0, this problem doesn't come at all. Everything works fine perfectly.
Any inside view will be appreciated..
regards,
manish


Check the getter method for the attribute that give that message. Even if the attribute actually exist but that message still display just because when Struts call the getter on the attribute an Exception is thrown from within the getter.
19 years ago
Hello,
I am implementing a customer user Registry for Websphere App Server 5.0 on WSAD 5.1. In the method
public List getUniqueGroupIds(String uniqueUserID)
This method is used to return the list of Groups a user may belong to. Here is a first extract of code of that method
String role1="ROLE1";
String role2="ROLE2";
groupList.add("ROLE1");
groupList.add("ROLE2");
return groupList;
Then I login a page restricted to ROLE1 only, WAS refuses access saying that the user is not granted the "ROLE1" role.
I switch to the following code:
groupList.add(Constants.ROLE1);
groupList.add(Constants.ROLE2);
return groupList;
Where Constants.ROLE1 has the declared value of "ROLE1"
Then I login a page restricted to ROLE1 only, WAS granted the user with ROLE1!
What's wrong the the groupList constructed from dynamically generated Strings?
I don't know how WAS handle String pool here? Can any body explain?
Thanks
19 years ago

Originally posted by Oliver Refle:
Why don't you just deliver the default property file ? then all users get the same language shown. If you want to provide more languages then add new localized property files.
Why do you want to set the locale in a property file ? Just offer a default language and nothing else.


Thanks Oliver,
But I want to have all application resource files at once and do not have to replace/delete application resource file when the application is re-deployed to serve another country. Specifying which country/language is active is done at deployment time by a single parameter. That's much simpler.
I am thinking of setting all requests's locale to a fixed value at the preProcess method of the ActionServlet.
19 years ago
Hi every body,
How can we set a fixed locale for the whole struts application so that Struts does not determine user's locale from the request?. My application does not serve users from multiple countries at once but I need a portable application that can be easily re-deployed to serve users from another country by just configuring the locale parameter in the properties file.
Many thanks
19 years ago
Does each connection in the pool corresponds to an Oracle user's session? It seems no. I've configured a pool of 50 connections in my datasource in WAS and run my web application which use the above DS to connect to Database but when I open the Oracle Enterprise manager console there's only one session for the user from the WAS machine.
BTW, when I killed that session in Oracle, my webapp can run without throwing SQLException. It seems the pool automatically create another session to Oracle to replace the killed one.
What do you think about this. It seems I do not have a good understanding of connection pooling. Hope you can explain.
Thanks