How to keep the same credential in the new thread

2001-07-03 Thread Zhiyong Li
Title: How to keep the same credential in the new thread






This is not a direct Struts question. But I will go ahead ask:

I am using WebLogic 6.0 on Sun Solaris. I have my servlet be protected by RDBMS realm. When the servlet is invoked, it will
spawn a new thread. However, this new thread gets a "guest" credential. For example,
weblogic.security.acl.Security.getCurrentUser.getName() will return "guest"


Is there a easy way to create a new thread however keep the "credential"?

Thanks,

Zhiyong Li

Platform Development

iBiomatics LLC ,  a SAS Company

(919) 653-2746

[EMAIL PROTECTED]






Install and run Struts with WebLogic

2001-01-02 Thread Zhiyong Li

Any one has instructions on how to install "Struts" on WebLogic server and how to run 
the example code. -- Thx, Zhiyong



[Q] struts:link with forward attribute on WebLogic 6.0

2001-01-05 Thread Zhiyong Li

I try to forward the request in a jsp page as follows:

<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts.tld" prefix="struts" %>


 
 

 
I have the "ibohome" defined in the action.xml as follows,

   
  

However, I got the following exception when I am trying to run it (I got
the same exception if I replace "success" with "ibohome").

Could not deserialize context attribute
java.io.NotSerializableException:
org.apache.struts.action.ActionForwards
at
java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:1148)
at
java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:366)
at
weblogic.servlet.internal.AttributeWrapper.getObject(AttributeWrapper.ja
va:71)
at
weblogic.servlet.internal.WebAppServletContext.getAttribute(WebAppServle
tContext.java:211
)
at
weblogic.servlet.jsp.PageContextImpl.getAttribute(PageContextImpl.java:1
64)
at org.apache.struts.taglib.LinkTag.hyperlink(LinkTag.java:348)
at org.apache.struts.taglib.LinkTag.doStartTag(LinkTag.java:270)
at
jsp_servlet._ibiomaticsportal._struts_test_zli._jspService(_struts_test_
zli.java:87)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.
java:208)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.
java:244)
at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServl
etContext.java:11
27)
at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.
java:1529)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
>
  
<[WebAppServletContext(8068452,DefaultWebApp_myserver)]
Root cause of ServletException
javax.servlet.jsp.JspException: Cannot locate forwards mapping table
at org.apache.struts.taglib.LinkTag.hyperlink(LinkTag.java:351)
at org.apache.struts.taglib.LinkTag.doStartTag(LinkTag.java:270)
at
jsp_servlet._ibiomaticsportal._struts_test_zli._jspService(_struts_test_
zli.java:87)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.
java:208)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.
java:244)
at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServl
etContext.java:11
27)
at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.
java:1529)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)


==
What I am trying to do is that when the index.html or index.jsp is
invoked, it will forward the request to my main page without user to
type anything. Any other approach I can take.

Thanks,
Zhiyong Li
Portal Development
iBiomatics LLC ,  a SAS Company
(919) 653-2746
[EMAIL PROTECTED]





RE: [Q] struts:link with forward attribute on WebLogic 6.0

2001-01-05 Thread Zhiyong Li

Do you have a quick answer to my last question in my previous note? The
question is included below.

What I am trying to do is that when the index.html or index.jsp is
invoked, it will forward the request to my main page without user to
type anything. The main page is a jsp which will be invoked by one of
the actions I will write. (I think what I need is to directly invoke the
Struts servlet with certain parameters without using struts:link). Any
other approach I can take.

Thanks,
Zhiyong

-Original Message-
From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 05, 2001 12:40 PM
To: [EMAIL PROTECTED]
Subject: Re: [Q] struts:link with forward attribute on WebLogic 6.0


Zhiyong Li wrote:

> I try to forward the request in a jsp page as follows:
>
> <%@ page language="java" %>
> <%@ taglib uri="/WEB-INF/struts.tld" prefix="struts" %>
>
> 
>  
>

Note that you'll probably want some text in between the beginning and
ending
tags, so you can actually see the hyperlink on the browser screen.

>
> 
>
> I have the "ibohome" defined in the action.xml as follows,
>
>
>path="/generic.do?jsp=/iBiomaticsPortal/MainContents.jsp"/>
>
> However, I got the following exception when I am trying to run it (I
got
> the same exception if I replace "success" with "ibohome").
>
> Could not deserialize context attribute
> java.io.NotSerializableException:
> org.apache.struts.action.ActionForwards
>

WebLogic 6.0 currently has a restriction that all servlet context
attributes in
a webapp have to be Serializable (not just session attributes).  I've
been going
through the various objects that Struts itself creates, and
ActionForwards
(among others) was recently made Serializable -- you should be able to
do this
with a very recent nightly build.

NOTE:  The Struts example application still won't work, though -- it
uses a
context attribute that is not serializable, so it won't work correctly
on this
platform.

Craig McClanahan





RE: [Q] struts:link with forward attribute on WebLogic 6.0

2001-01-05 Thread Zhiyong Li

What is the syntax? I tried, 

 


None of them work. ("generic" is a action defined in the action.xml). 

Zhiyong 

-Original Message-
From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 05, 2001 2:23 PM
To: [EMAIL PROTECTED]
Subject: Re: [Q] struts:link with forward attribute on WebLogic 6.0


Zhiyong Li wrote:

> Do you have a quick answer to my last question in my previous note?
The
> question is included below.
>
> What I am trying to do is that when the index.html or index.jsp is
> invoked, it will forward the request to my main page without user to
> type anything. The main page is a jsp which will be invoked by one of
> the actions I will write. (I think what I need is to directly invoke
the
> Struts servlet with certain parameters without using struts:link). Any
> other approach I can take.
>

If you want to forward totally transparently, doesn't  do
the
trick?

>
> Thanks,
> Zhiyong
>

Craig





RE: [Q] struts:link with forward attribute on WebLogic 6.0

2001-01-05 Thread Zhiyong Li

That fixed problem. I actually need to add extra path to "/generic.do",
but the idea is correct.

-Original Message-
From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 05, 2001 4:21 PM
To: [EMAIL PROTECTED]
Subject: Re: [Q] struts:link with forward attribute on WebLogic 6.0


Zhiyong Li wrote:

> What is the syntax? I tried,
>
>  
> 
>
> None of them work. ("generic" is a action defined in the action.xml).
>

It should be a context-relative path to your action or page.  For
example, if
you use the normal style of mapping the Struts servlet to "*.do", it
would be



NOTE:  The  tag mentioned earlier is only in Struts 1.0 -- I
don't
think it was in Struts 0.5.

>
> Zhiyong
>

Craig


>
> -Original Message-
> From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
> Sent: Friday, January 05, 2001 2:23 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [Q] struts:link with forward attribute on WebLogic 6.0
>
> Zhiyong Li wrote:
>
> > Do you have a quick answer to my last question in my previous note?
> The
> > question is included below.
> >
> > What I am trying to do is that when the index.html or index.jsp is
> > invoked, it will forward the request to my main page without user to
> > type anything. The main page is a jsp which will be invoked by one
of
> > the actions I will write. (I think what I need is to directly invoke
> the
> > Struts servlet with certain parameters without using struts:link).
Any
> > other approach I can take.
> >
>
> If you want to forward totally transparently, doesn't  do
> the
> trick?
>
> >
> > Thanks,
> > Zhiyong
> >
>
> Craig




RE: Strange problem using Weblogic 6.0

2001-01-11 Thread Zhiyong Li

I had the same problem. Is there a work around from either Struts or
WebLogic (any WebLogic people out there)?

Thx,
Zhiyong 


-Original Message-
From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 11, 2001 1:03 PM
To: [EMAIL PROTECTED]
Subject: Re: Strange problem using Weblogic 6.0


Thierry Cools wrote:

>  Hi Craig, Thanks for your explanations, but the problem is different,
maybe I
> was not very clear in my first mail. The problem is that, as you can
see in
> the adress link, Weblogic add '/' characters in the jsessionid and the
servlet
> engine doesn't seems to be able to recognize that the session id is
not a part
> of the context path, so that the context path contains the real
context path +
> the session id, the result of this is that the application can not
access all
> following links because of this. I hope it was more clear this time.
Thanks
> for your help,Thierry
> Thierry Cools

This looks like a bug in the way WebLogic is doing URL rewriting.

The session id is required (by the servlet spec) to be passed as a
*path*
parameter, not a *query* parameter.  According to the RFC for URL syntax
(I
believe it's 2396, but don't have it available at the moment to check),
the
overall syntax goes like this:

scheme://host:port/resource-path;path-parameters?query-parameters

in other words, if I start with a URL like this:

http://myhost/myapp/logon.do?name=value

I should end up with a URL like this:

http://myhost/myapp/logon.do;jsessionid=12345?name=value

(which is what Tomcat and every other container I've tested does).  It
looks to
me like Weblogic is sticking the session id before the "/logon.do" part,
which
basically screws up the resource-path part of your URL.

Craig





set methods in ActionForm

2001-01-23 Thread Zhiyong Li

I have two questions related with the set methods in any of the Form
class, such as MyActionForm.

1. It seems to me that if we use a form with POST method, the
corresponding "set" method will be called as it should be. What I want
to confirm is that if I have the URL with query string, does the
parameter specified overthere also cause the "set" to be called? For
example, I have the URL: http://.../action?name=value And in the
MyActionForm.java, I have the method:

public void setName(String name) {name = value;}

My experiment shows that when I clicked the URL, setName got called. 

2. My second question is that I found the "set" method did not got
called if the length of the "keyword" is 2. For example, in the above
example, if "name" is "aT" and I have the "set" method,

public void setAT(String aT) {aT = value;}

The "setAT" does not got called. 

Thank you for the help,
Zhiyong Li
Platform Development
iBiomatics LLC ,  a SAS Company
(919) 653-2746
[EMAIL PROTECTED]





FormAction scope

2001-01-26 Thread Zhiyong Li

I understand that the default scope of the "FormAction" bean is
"session", which means that only one "FormAction" bean instance will be
created for each session. Is there a way to specify the scope of the
"FormAction" to be "request"? We probably can do this with Struts's form
tag. But that is not what I want. In my case, this "FormAction" bean may
be invoked from a href in addition to the forms. 

Thx,
Zhiyong Li
Platform Development
iBiomatics LLC ,  a SAS Company
(919) 653-2746
[EMAIL PROTECTED]





Set default file names in the upload

2001-04-26 Thread Zhiyong Li
Title: Set default file names in the upload






This may not be a direct Struts question. But I hope to get the response from here ...


In using the file upload, which is , I would like to set a default value for the file name. However, I cannot find a way to accomplish this. These are the approaches I tried;

     


or 


    function setDefaultName(){

        document.frmGroup.F0.value="c:\\temp";

    }


I am using IE 5. I was told that for the security reason, the browser does not allow you to do this. I would like to confirm on that. 

 

Thanks for your help,

Zhiyong Li

Platform Development

iBiomatics LLC ,  a SAS Company

(919) 653-2746

[EMAIL PROTECTED]






Struts 1.0 with WebLogic 6.1

2001-10-05 Thread Zhiyong Li

I downloaded the Struts 1.0 release and copy the struts-example.war to
my WebLogic applications directory. When I tried to run "index.jsp" at
that example package, I got the following compiler errors.

symbol  : method setScope  (java.lang.String)
location: class org.apache.struts.taglib.logic.NotPresentTag
 
_logic_notPresent0.setScope(weblogic.utils.StringUtils.valueOf("applicat
ion")); //[
/index.jsp; Line: 21]
  ^

Thank you for your help,
Zhiyong Li
Platform Development
iBiomatics LLC ,  a SAS Company
(919) 653-2746
[EMAIL PROTECTED]





Several design questions for a large application

2001-10-22 Thread Zhiyong Li

I have used Struts as the core control component for the first release
of the iBiomatics knowledge platform. I am very happy with it,
especially it encourages all the developers to think and code in a way
consistent with Model-2 architecture. However, I have not fully used all
the functions of Struts, especially "form beans",  "form tags", other
attributes defined in "struts_action.xml" (such as "forward", "error").

Here are the reasons why I did not use those features. I would like to
get your feedback and I would like to use more Struts features in the
future releases of my product.

The application I have been building is a middle/large size product,
which has many different functions (actions). Each function can have
many different sub-functions. One of my goal is to have only a "handful"
action classes. Each action denotes an entry point for a specific
function. Therefore, each action class will act like a "dispatcher" and
invoke different bean classes (let us call it "action bean") to do the
real work for different sub-functions (for example, interact with the
server side components). To retrieve the parameter's values from the
"POST/GET" request, I have a corresponding "form bean" class for each
"action bean". All of these bean and form classes may extend a basic
bean or form class to make the code reusable. Because of this design, it
seems that I can not specify which "form" class to use in the
"struts_action.xml". I really need a way for "Struts" to get hold of a
"sub form bean object". Similar, I can not specify "forward" in the
"struts_action.xml". 

Given "form tag" uses a form bean to retrieve form values and my design
described above, it is not easy to know which "form" bean to use. One
way is probably that I set it up in "action bean" and JSP will get which
"form bean" to use from this "action bean".

If all of these descriptions confuse you, I have several generic
questions you may be able to help me:

1. How valuable to use "form" bean supported by "Struts"?
2. How flexible of using "forward" as the flow control to go to
different pages? I found it limited since you have to define it in the
"struts_action.xml". This is not flexible if you want to "forward" to
different locations according to the values in the request.

Thanks for your comments,
Zhiyong Li
Platform Development
iBiomatics LLC ,  a SAS Company
(919) 653-2746
[EMAIL PROTECTED]





add extra name-value pairs at struts-config.xml

2001-11-14 Thread Zhiyong Li

I would like to add extra name-value pairs at struts-config.xml and to
be able to retrieve it from my action classes. Any one has a sample code
on how to do this? I am using Struts 1.0

Zhiyong Li
Platform Development
iBiomatics LLC ,  a SAS Company
(919) 653-2746
[EMAIL PROTECTED]



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




Can I use a jsp as the action value in: html:form

2002-01-14 Thread Zhiyong Li

I tried to use a jsp as the action target, for example,



However, I got the exception: 
javax.servlet.ServletException: Cannot retrieve mapping for action
/p21/security/businesslogin 

Can I use a jsp as the action target with the html:form tag?

Thanks,

Zhiyong Li
iBiomatics R & D
SAS Institute
(919) 653-2746
[EMAIL PROTECTED]




--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




RE: Can I use a jsp as the action value in: html:form

2002-01-15 Thread Zhiyong Li

I did what you suggested. However, I got the following exception:

javax.servlet.ServletException: Cannot retrieve definition for form bean
null

Any ideas?

Zhiyong Li
iBiomatics R & D
SAS Institute
(919) 653-2746
[EMAIL PROTECTED]




-Original Message-
From: Matt Raible [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 14, 2002 4:12 PM
To: Struts Users Mailing List
Subject: Re: Can I use a jsp as the action value in: html:form


The easiest way is to put an action mapping in your struts-config file:





--- Zhiyong Li <[EMAIL PROTECTED]> wrote:
> I tried to use a jsp as the action target, for example,
> 
> 
> 
> However, I got the exception: 
> javax.servlet.ServletException: Cannot retrieve mapping for action
> /p21/security/businesslogin 
> 
> Can I use a jsp as the action target with the html:form tag?
> 
> Thanks,
> 
> Zhiyong Li
> iBiomatics R & D
> SAS Institute
> (919) 653-2746
> [EMAIL PROTECTED]
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
> 


__
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/

--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




General JSP question: how to protect the JSP source code

2002-01-31 Thread Zhiyong Li

When I ship a product with JSP code, I would like to avoid the direct
shipping of the JSP source code. It seems that there is a way I can just
ship the compiled JSP code. I tried this, but I can not get it work in
Tomcat. 

Any one knows that whether this is a standard feature (you can just ship
compilered code) or it is only supported by certain app. servers. If it
is a standard feature, how to get it work? 

Thanks,
Zhiyong Li
Analytical Solutions, SAS Institute
(919) 653-2746
[EMAIL PROTECTED]



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>