Re: [iPlanet-JATO] Transaction in JATO
Jeff--
I have one thing to add. You can obtain a JDBC Connection in several ways.
First is to simply use a JNDI lookup on your own, as you would in any J2EE
application. The second it to use JATO's SQLConnectionManager (available in
the RequestContext), which provides some additional convenience by
interposing a level of datasource mapping indirection (see docs). Third,
you can obtain the connection that any given QueryModel would use by
default by calling its "getDefaultConnection()" method. This saves you from
worrying at all about the JDBC datasource name used to obtain the
connection.
Any one of these three techniques is perfectly fine; choose the one that
makes sense for the maintainability of the application in the long run.
Todd
Todd Fast
Senior Engineer
Sun/Netscape Alliance
todd.fast@s...
----- Original Message -----
From: "Mike Frisino" <Michael.Frisino@s...>
Sent: Wednesday, October 24, 2001 1:25 PM
Subject: Re: [iPlanet-JATO] Transaction in JATO
Jeff,
See the javadoc for DatasetSQLModelExecutionContext. It may seem a bitcounterintuitive, since for updates and inserts you do not need the full
dataset capability, but you don't use what you don't need.
>
In your case, what you do want to take advantage of is the ability tocontrol the "JDBC Connection" directly. Therein lies the transactional
control that you are looking for. NetD needed to rely on something like the
CSpTransaction class precisely because it did not allow developers direct
access to the JDBC Connection. That is no longer a restriction in JATO,
hence, there is no equivalent to CSpTransaction per se.
>
>
public class DatasetSQLModelExecutionContext
extends DatasetModelExecutionContextImpl
implements SQLModelExecutionContext
An execution context used to execute dataset operations on QueryModels(normally SQL SELECT operations). Developers can specify both the dataset
offset and size, as well as a JDBC connection or statement object, to be
used during execution of the model.
>
By providing a connection or statement object to the model via thiscontext, developers can maintain control of the transaction state of the
connection instead of relying on the default behavior (which is generally
equivalent to auto-commit semantics). However, such use also introduces a
measure of responsibilty on the developer--because providing these objects
to the model manually causes the model to avoid any connection lifecycle
management of its own, the developer is completely responsible for managing
the lifecycle of the connection, as well as the lifecycle of any
transactions that might be pending on that connection.
>
In general, if the developer supplies a connection object, he or she neednot also supply a statement object. Conversely, if the developer supplies a
statement object, he or she need not specify a connection object (though he
will need to keep a reference to the connection object used to create the
statement in order to close it after execution is complete). In both cases,
the developer is ultimately responsible for releasing the connection
manually when use of it is complete.
>
----- Original Message -----
From: jeffrey_smith@p...
Sent: Wednesday, October 24, 2001 12:52 PM
Subject: [iPlanet-JATO] Transaction in JATO
Does anyone have an example on how to do multiple updates/inserts using
various models in one transaction in JATO1.2. I am trying to migrate ND
code that uses a CSpTransaction object to do this and there does notappear
to be an equivalent object in JATO.
Thanks.
Jeff Smith
Senior Application Consultant
Software Engineering
Putnam Investments
voice: (617)760-3121
fax: (617)760-3850
Choose from 1000s of job listings!
For more information about JATO, please visit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp
[Non-text portions of this message have been removed]
For more information about JATO, please visit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp
Jeff--
I have one thing to add. You can obtain a JDBC Connection in several ways.
First is to simply use a JNDI lookup on your own, as you would in any J2EE
application. The second it to use JATO's SQLConnectionManager (available in
the RequestContext), which provides some additional convenience by
interposing a level of datasource mapping indirection (see docs). Third,
you can obtain the connection that any given QueryModel would use by
default by calling its "getDefaultConnection()" method. This saves you from
worrying at all about the JDBC datasource name used to obtain the
connection.
Any one of these three techniques is perfectly fine; choose the one that
makes sense for the maintainability of the application in the long run.
Todd
Todd Fast
Senior Engineer
Sun/Netscape Alliance
todd.fast@s...
----- Original Message -----
From: "Mike Frisino" <Michael.Frisino@s...>
Sent: Wednesday, October 24, 2001 1:25 PM
Subject: Re: [iPlanet-JATO] Transaction in JATO
Jeff,
See the javadoc for DatasetSQLModelExecutionContext. It may seem a bitcounterintuitive, since for updates and inserts you do not need the full
dataset capability, but you don't use what you don't need.
>
In your case, what you do want to take advantage of is the ability tocontrol the "JDBC Connection" directly. Therein lies the transactional
control that you are looking for. NetD needed to rely on something like the
CSpTransaction class precisely because it did not allow developers direct
access to the JDBC Connection. That is no longer a restriction in JATO,
hence, there is no equivalent to CSpTransaction per se.
>
>
public class DatasetSQLModelExecutionContext
extends DatasetModelExecutionContextImpl
implements SQLModelExecutionContext
An execution context used to execute dataset operations on QueryModels(normally SQL SELECT operations). Developers can specify both the dataset
offset and size, as well as a JDBC connection or statement object, to be
used during execution of the model.
>
By providing a connection or statement object to the model via thiscontext, developers can maintain control of the transaction state of the
connection instead of relying on the default behavior (which is generally
equivalent to auto-commit semantics). However, such use also introduces a
measure of responsibilty on the developer--because providing these objects
to the model manually causes the model to avoid any connection lifecycle
management of its own, the developer is completely responsible for managing
the lifecycle of the connection, as well as the lifecycle of any
transactions that might be pending on that connection.
>
In general, if the developer supplies a connection object, he or she neednot also supply a statement object. Conversely, if the developer supplies a
statement object, he or she need not specify a connection object (though he
will need to keep a reference to the connection object used to create the
statement in order to close it after execution is complete). In both cases,
the developer is ultimately responsible for releasing the connection
manually when use of it is complete.
>
----- Original Message -----
From: jeffrey_smith@p...
Sent: Wednesday, October 24, 2001 12:52 PM
Subject: [iPlanet-JATO] Transaction in JATO
Does anyone have an example on how to do multiple updates/inserts using
various models in one transaction in JATO1.2. I am trying to migrate ND
code that uses a CSpTransaction object to do this and there does notappear
to be an equivalent object in JATO.
Thanks.
Jeff Smith
Senior Application Consultant
Software Engineering
Putnam Investments
voice: (617)760-3121
fax: (617)760-3850
Choose from 1000s of job listings!
For more information about JATO, please visit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp
[Non-text portions of this message have been removed]
For more information about JATO, please visit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp
Similar Messages
-
Re: [iPlanet-JATO] from a non jato application to jato application
Without getting into the details, the session id is passed around in a
cookie, but once you leave your JATO app "sandbox", you no longer have
access to the same session. This is not a JATO limitation, but a J2EE
spec constraint. The war file creates a Servlet Context. Other servlet
contexts have separate session sandboxes. If you deployed all your apps
within the same war file, your sessions would be mutually accessible.
or
You could do something like use a Session EJB and pass its reference
between apps I suppose.
Also, see JATO Tip #0011 for forwarding to a "non-JATO" target.
Hopefully, my reply will open up a conversation for more solutions,
ideas, if what I have proposed is insufficient.
craig
raju_jato wrote:
how can we forward a request from a non jato application(build using
jsp and servlet) to a jato application and back and have only one
session for both the applications.
thanks
For more information about JATO, including download information, please visit:
http://developer.iplanet.com/tech/appserver/framework/index.jspWithout getting into the details, the session id is passed around in a
cookie, but once you leave your JATO app "sandbox", you no longer have
access to the same session. This is not a JATO limitation, but a J2EE
spec constraint. The war file creates a Servlet Context. Other servlet
contexts have separate session sandboxes. If you deployed all your apps
within the same war file, your sessions would be mutually accessible.
or
You could do something like use a Session EJB and pass its reference
between apps I suppose.
Also, see JATO Tip #0011 for forwarding to a "non-JATO" target.
Hopefully, my reply will open up a conversation for more solutions,
ideas, if what I have proposed is insufficient.
craig
raju_jato wrote:
how can we forward a request from a non jato application(build using
jsp and servlet) to a jato application and back and have only one
session for both the applications.
thanks
For more information about JATO, including download information, please visit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp -
Re: [iPlanet-JATO] Re: onSecurityCheckFailedEvent & & onSessionTimeoutEvent
My mistake. Thanks for the clarification, Craig.
Todd
----- Original Message -----
From: "Craig V. Conover" <craig.conover@s...>
Sent: Friday, January 04, 2002 11:14 AM
Subject: Re: [iPlanet-JATO] Re: onSecurityCheckFailedEvent & &
onSessionTimeoutEvent
Alex,
In addition to Todd saying that the ND security object "is nothing morethan a
sessionable object...", remember that the security object did nothing morethan
retrieve the user profile from some persistent store: a database or athird party
API. So the security object was just a very specialized model (a dataobject in ND
terms, of course), although it need not be a model, it could just be anarbitrary
Java class, whatever works best.
Once the security object was triggered to perform a user profile lookup,the
profile was stored in an instance of CSpUserProfile and kept in the user's
session. The project object was then the object that was responsible forchecking
the user profile for privileges, previous pages, and db logins and such.As Todd
explained, the ViewBean API now does the security check (as opposed toJATO's
module servlet, or ND's project object), so extending ViewBeanBase andoverriding
securityCheck is a convenient way to mimic ND's security hooks. You couldeven
override a method or event in the module servlet to do a lookup if youwant a
greater parallel to ND, but this is unneccessary. Either way, the securitycheck
is performed before the "page" is "loaded".
c
Todd Fast wrote:
Agreed. This is partly why we have never added such a feature to JATO
(though we've talked about it many many times), because it seemed too
prescriptive and possibly at odds with the other solutions people favor.
We're still on the fence. We want to add it, but feel it'll take a fair
bit
of design to do properly and extensibly.
However, realize that the ND security object is nothing more than a
sessionable object with slots for username, password, and priveleges.This
is almost trivially easy to replicate on your own, with a small additionof
code to automatically handle lifecycle and security checking. It wouldbe
extremely easy to create a subclass of ViewBeanBase that would overridethe
securityCheck() method to check the state of a sessioned "user profile"
object. Add to the ViewBean a declared set of "privelege" strings, andyou
can check the profile object against those required.
I feel I'm being unclear--do you see where I'm going?
Todd
----- Original Message -----
From: "njdoe123" <first.us@a...>
Sent: Friday, December 28, 2001 6:44 AM
Subject: [iPlanet-JATO] Re: onSecurityCheckFailedEvent & &
onSessionTimeoutEvent
Hi,
We used a lot of "security object" in netD projects. Each used
username, password and privilege for login. After migration,
we have to hand code all login codes manually. Session control
is pretty standard in j2ee, i'm wondering whether there is a
best practice example available for netD login feature.
Since security was one of the outstanding feature in netD, it will
be a great idea to have a stadard plugin to support this feature
after migration. I wish v1.2 could supply a direction, although
there are several login methods in j2ee.
Thanks,
Alex Lin
--- In iPlanet-JATO@y..., "Todd Fast" <todd.fast@s...> wrote:
Small correction: the name of the method in ViewBean is"securityCheck()",
not "onSecurityCheck()". The method would've been better named
"checkSecurity()", but too late now. <grin>
Todd
----- Original Message -----
From: "Craig V. Conover" <craig.conover@s...>
Sent: Monday, December 17, 2001 12:47 PM
Subject: Re: [iPlanet-JATO] onSecurityCheckFailedEvent & &
onSessionTimeoutEvent
The iMT has a ND to JATO/J2EE mapping document that covers ND
events and
common ND class/variable/method mapping.
To answer you two questions below:
onSessionTimoutEvent is onSessionTimeout in JATO and can beoverriden in
any class the subclasses JATO'scom.iplanet.jato.ApplicationServletBase.
Typically, this is done in you application servlet class which allof
your module servlets in the application will subclass.
onSecurityCheckFailedEvent is an ND specific event that istriggered
when a Security exception is thrown in ND. In JATO, a
SecurityCheckException is thrown when the default securitychecking in
JATO fails. JATO's default security is to make sure theRequestContext
object is not null. This is done in the ViewBean API. The
onSecurityCheck event in JATO allows you to hook into thisbehavior and
write your own security checking, or hook in a third party API.You can
call super so that you still get the RequextContext null check.
You should create a "non-visual" ViewBean (behavior only) thatoverrides
the onSecurityCheck event, and all other ViewBeans in yourapplication
extend it to inherit this security checking behavior.
You could also hook in the security in your application Servlet by
overriding one of the events in ApplicationServletBase, like
onBeforeRequest.
craig
njdoe123 wrote:
Hi,
We have the following two events (onSecurityCheckFailedEvent
& onSessionTimeoutEvent) across all ND projects. I guess
it's pretty common for netdynamics project.
How do you solve the corresponding issues in j2ee ?
Is there any example available ?
Thanks,
Alex
//[[SPIDER_EVENT<this_onSecurityCheckFailedEvent>
public int this_onSecurityCheckFailedEvent
(CSpProjectSecurityEvent event)
switch (event.getFailureType() )
case NEW_SECURITY_CHECK_PRIV_FAILURE_TYPE:
// do something
CSpPage loginPage1 = CSpider.getPage("PgLogin");
CSpString msg1 = new CSpString("Wrong District Code, UserID
or
Password. Try again.");
loginPage1.setDisplayFieldValue("StMsg1", msg1);
loginPage1.load (false);
break;
case SESSION_CONTINUITY_FAILURE_TYPE:
// do something else
CSpPage loginPage2 = CSpider.getPage("PgLogin");
CSpString msg2 = new CSpString("You must login first...");
loginPage2.setDisplayFieldValue("StMsg1", msg2);
loginPage2.load (false);
break;
return (STOP);
//]]SPIDER_EVENT<this_onSecurityCheckFailedEvent>
//[[SPIDER_EVENT<this_onSessionTimeoutEvent>
public int this_onSessionTimeoutEvent(CSpProjectSessionEventevent)
CSpString msg3 = new CSpString("You were gone too long - login
again");
CSpPage loginPage3 = CSpider.getPage("PgLogin");
loginPage3.setDisplayFieldValue("StMsg1", msg3);
// stop any further processing of this original user request
loginPage3.setDisplayFieldValue("District_ID", newCSpString(""));
loginPage3.setDisplayFieldValue("User_ID", new CSpString(""));
loginPage3.setDisplayFieldValue("Password", newCSpString(""));
loginPage3.load (false);
return (PROCEED);
//]]SPIDER_EVENT<this_onSessionTimeoutEvent>
For more information about JATO, please visit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp
For more information about JATO, please visit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp
Service.
For more information about JATO, including download information,
please
visit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp
For more information about JATO, including download information, pleasevisit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp
For more information about JATO, including download information, pleasevisit:
http://developer.iplanet.com/tech/appserver/framework/index.jspThank you - Jin and Todd.
Will try that.
Atul
--- In iPlanet-JATO@y..., Byung Jin Chun <bchun@n...> wrote:
try using kregedit and modify the key for the jvm args, using the -x
parameters for the 1.2 runtime
Jin
-----Original Message-----
From: Todd Fast [mailto:<a href="/group/SunONE-JATO/post?protectID=101233080150035167169232031248066208071048">Todd.Fast@S...</a>]
Sent: Tuesday, February 19, 2002 8:40 PM
Subject: Re: [iPlanet-JATO] Re: OutOfMemoryError
Atul--
Out of curiosity - How do you modify the memory parameters for
the container's VM ?? I know I should try to do some research but
figured you may already have some insight and willingness to
share.
Please consider this as low priority.It differs by container; I don't remember details of any particular one.
>
Todd
For more information about JATO, including download information, please
visit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp
<http://developer.iplanet.com/tech/appserver/framework/index.jsp>
[Non-text portions of this message have been removed] -
Is there an example of this somewhere or some documentation? I'm using Jato
1.2.
Also, in the emails that fly back and forth I have seen a date sample
mentioned.
Where is this? I have got the JatoSamples.war deployed and I don't see a date
example. I just wonder if I'm missing some other Jato examples.
Thanks.
BelindaThere is some confusion here. The JatoSample project that shipped with the
Developer CD does not include the Components samples (which includes the Date
example). The "live" sample that is viewable on the intenal web site
http://ias.red.iplanet.com/jato/ does include the Component samples.
We intentionally disabled the Component samples in the Developer CD version
because at the time that it shipped we had an unresolved issue with running the
Component samples on certain servlet containers. That issue has been favorably
resolved.
The downloadable version of Jato 1.2 should contain a version of the JatoSample
which does have the Component sample enabled.
----- Original Message -----
From: Matthew Stevens
Sent: Thursday, November 29, 2001 8:39 AM
Subject: RE: [iPlanet-JATO] applying style sheets to Jato
Belinda,
Sorry for the delay. JATO is now available on http://developer.iplanet.com
and the JATO Sample WAR file is available separately for download - so make
sure you have this latest example. The sample is available LIVE on internal
sites which I will send you offline. We are working to have this and other
samples running live on the public web site shortly.
For the Date component example please check out the Components section in
the Index of the running application and the following in the WAR file
WEB-INF/classes/jatosample/module1/E0130Viewbean.java
WEB-INF/jatoSample.tld
WEB-INF/classes/jatosample/components
Could you please elaborate on your requirements for style sheets. Other
than using style sheets normally as you would with JSPs, what are you trying
to do? We would like to be focused in our answers.
matt
-----Original Message-----
From: Belinda Garcia [mailto:<a href="/group/SunONE-JATO/post?protectID=014056235009078154169082148140172241239144044214017123152006048067">belinda.garcia@s...</a>]
Sent: Tuesday, November 27, 2001 5:08 PM
Subject: [iPlanet-JATO] applying style sheets to Jato
Is there an example of this somewhere or some documentation? I'm using Jato
1.2.
Also, in the emails that fly back and forth I have seen a date sample
mentioned.
Where is this? I have got the JatoSamples.war deployed and I don't see a
date
example. I just wonder if I'm missing some other Jato examples.
Thanks.
Belinda
For more information about JATO, please visit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp
For more information about JATO, please visit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp
[Non-text portions of this message have been removed] -
There is an error in the TestFieldTag.java file that generates the HTML in
correctly. If you give the Textfield a MaxLength is comes out in HTML as
<jato:textField name="tbTrackingID" size="25" maxLength="256" />
<input type="text" name="pgAuditSearch.tbTrackingID" value="""
maxLength="256"" size="25">
Notice the value has three " marks and the maxLength does as well. This can
be a problem, eps. with javascript.
There is a spot in the code where the HTML tag is being generated and it
writes to a buffer. It has an extra .append with ("\"") that gives this
error.
Just FYI in case anyone else has encountered problems like this.
Eric Hagopian
Bank of America Direct
eric.hagopian@b...
312.974.6411Eric--
Thanks for letting us know. I believe this one got fixed early in our 1.1
cycle, as it doesn't appear to be a problem now.
Cheers,
Todd
----- Original Message -----
From: <eric.hagopian@b...>
Sent: Friday, February 16, 2001 9:16
Subject: [iPlanet-JATO] Error in JATO textfield tag
There is an error in the TestFieldTag.java file that generates the HTML in
correctly. If you give the Textfield a MaxLength is comes out in HTML as
<jato:textField name="tbTrackingID" size="25" maxLength="256" />
<input type="text" name="pgAuditSearch.tbTrackingID" value="""
maxLength="256"" size="25">
Notice the value has three " marks and the maxLength does as well. Thiscan
be a problem, eps. with javascript.
There is a spot in the code where the HTML tag is being generated and it
writes to a buffer. It has an extra .append with ("\"") that gives this
error.
Just FYI in case anyone else has encountered problems like this.
Eric Hagopian
Bank of America Direct
eric.hagopian@b...
312.974.6411
[email protected] -
Would like to use SUN Jato GUI Framework in my app
Hi Everyone,
not sure if this is the correct forum to post this..
i have an existing web app that i would like to use the jato framework.
i took a simple page from the jato/glassfish app: welcome.jsp/.java and copied it to my app directories (also copied the needed, tld's jars etc)
i googled and only get 1 hit to the error message which really didn't help me.
exception
javax.servlet.ServletException: javax.servlet.jsp.JspException: The request context is null - this page must be accessed through a servlet
root cause
javax.servlet.jsp.JspException: The request context is null - this page must be accessed through a servlet
com.iplanet.jato.taglib.UseViewBeanTag.doStartTag
i looked at the jatosample application, but am trying to figure out what it is I need. obviously its a servlet but what,where, how,why
<code>
<html>
<%@page info="HelloWorld" language="java"%>
<%@taglib uri="/WEB-INF/tld/jato.tld" prefix="jato"%>
<jato:useViewBean className="jatosample.module1.HelloWorldViewBean">
<head>
<title>JATO Sample Application</title>
</head>
<body>
Hello, world!
</body>
</jato:useViewBean>
</html>
</code>
any guidance appreciated.
Johnny
Message was edited by:
sticcinoI don't use that device, but two links with more information
-what is in the entire Cloud http://www.adobe.com/creativecloud/catalog/desktop.html
-http://www.adobe.com/products/catalog/mobile._sl_id-contentfilter_sl_catalog_sl_mobiledevi ces.html -
How to forward to another page from beginDisplay
I have to forward to Page 2 in beginDisplay method of Page1 based on
some parameters. I am having trouble aborting the current page
(Page1) load.
I tried the following:
if (from.equals("xyz"))
ViewBean targetView = getViewBean(pgPage2ViewBean.class);
targetView.forwardTo(getRequestContext());
throw new CompleteRequestException();
Both Page1 and Page2 are getting loaded. Page2 on top and Page1 at
the bottom.
Thanks,
RaviRavi,
Please see this solution.
Inside the beginDisplay() method of ViewBean :
public void beginDisplay() throws ModelControlException
super.beginDisplay();
// Do your processing here ?.
// You detected not to display this page?and want to display Target.jsp
// implement this method in your super class
setRequestAborted(true);
// forward to TargetPage
ViewBean targetView = getViewBean(TargetViewBean.class);
targetView.forwardTo(getRequestContext());
Add thse two methods in your superclass of the viewBean.
// These two method are used to forward the control from one page to another
page.
public void setRequestAborted(boolean requestAborted)
this.requestAborted = requestAborted;
public boolean isRequestAborted()
return requestAborted ;
- Also, code the following scriplet inside the JSP of this ViewBean so that no
content would be rendered.
--- (BOF) ---
<useViewBean ...>
<%
if(!viewBean.isRequestAborted())
%>
<html>
... all HTML content here ...
</html>
<%
} //End of if(viewBean.isRequesteAborted())
%>
</jato:useViewBean>
--- (EOF) ---
- JATO:Content tag can also be used for this purpose.
Hope this solves your problem.
Thanks,
Subir.
ravi_ponnaganti@y... wrote:
I have to forward to Page 2 in beginDisplay method of Page1 based on
some parameters. I am having trouble aborting the current page
(Page1) load.
I tried the following:
if (from.equals("xyz"))
ViewBean targetView = getViewBean(pgPage2ViewBean.class);
targetView.forwardTo(getRequestContext());
throw new CompleteRequestException();
Both Page1 and Page2 are getting loaded. Page2 on top and Page1 at
the bottom.
Thanks,
Ravi
For more information about JATO, please visit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp
Information transmitted by this E-MAIL is proprietary to Wipro and/or its
Customers and
is intended for use only by the individual or entity to which it is
addressed, and may contain information that is privileged, confidential or
exempt from disclosure under applicable law. If you are not the intended
recipient or it appears that this mail has been forwarded to you without
proper authority, you are notified that any use or dissemination of this
information in any manner is strictly prohibited. In such cases, please
notify us immediately at mailto:mailadmin@w... and delete this mail
from your records.
[Non-text portions of this message have been removed] -
I am having a problem relacing the include file of let's call it a
header.jsp in a menu page named menu.jsp.
So in my header.jsp file let's say I do something simple like
<table>
<tr><td><jato:href name="first">First Option
</jato:href></td></tr></table>
and so on....
And in my main.jsp I have a simple include at the top of my page
like so
<html
<body>
<%include file=header.jsp%>
etc.
Now when JRun 3.0 makes the include replacement, it seems to have a
problem where it tells me
Servlet error 500
com.iplanet.jato.view href : taglib navigation not found
BUT when I take out the jato tags in the include file...I can get
JRun to make the replacement perfectly....
Does anyone else have this problem and if so how did you get around
it?Sorry to bother you again, but I couldn't find anything that looked strange
is this file. Can you send us the original file at our personal email
addresses? I'd like to see exactly where the compilation error occurs and
it's not possible with the file inlined here.
todd.fast@e...
michael.frisino@s...
Thanks,
Todd
----- Original Message -----
From: <suket@u...>
Sent: Wednesday, January 17, 2001 2:02
Subject: [iPlanet-JATO] Re: include jsp tags
Hi Mike,
Both of the jsp files (pgHelp.jsp and pgFooter.jsp)
are in the same folder. I removed the IPP/ipp portion in the
include directive but still giving the same err.
iam using Allair Jrun 3.0.
Here is the intermediary generated Jsp file
/ Generated by JRun, do not edit
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;
import allaire.jrun.jsp.JRunJSPStaticHelpers;
public class jrun__IPP__ipp__pgHelp2ejsp13 extends
allaire.jrun.jsp.HttpJSPServlet implements
allaire.jrun.jsp.JRunJspPage
private ServletConfig config;
private ServletContext application;
private Object page = this;
private JspFactory __jspFactory = JspFactory.getDefaultFactory();
public void _jspService(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, java.io.IOException
if(config == null) {
config = getServletConfig();
application = config.getServletContext();
response.setContentType("text/html; charset=ISO-8859-1");
PageContext pageContext = __jspFactory.getPageContext(this,
request, response, null, true, 8192, true);
JspWriter out = pageContext.getOut();
HttpSession session = pageContext.getSession();
try {
out.print("\r\n\r\n");
IPP.ipp.pgHelpViewBean viewBean = (IPP.ipp.pgHelpViewBean)
pageContext.getAttribute("viewBean", PageContext.REQUEST_SCOPE);
if(viewBean == null) {
if(JRunJSPStaticHelpers.getAndSetBean(pageContext,
"viewBean", IPP.ipp.pgHelpViewBean.class
, PageContext.REQUEST_SCOPE, 3)) {
viewBean = (IPP.ipp.pgHelpViewBean)pageContext.getAttribute
("viewBean", PageContext.REQUEST_SCOPE);
} else {
viewBean = (IPP.ipp.pgHelpViewBean)pageContext.getAttribute
("viewBean", PageContext.REQUEST_SCOPE);
pageContext.setAttribute("viewBean",viewBean);
out.print("\r\n");
com.iplanet.jato.taglib.UseViewBeanTag useViewBean__4_1 =
(com.iplanet.jato.taglib.UseViewBeanTag)
JRunJSPStaticHelpers.createTagHandler(pageContext,
"com.iplanet.jato.taglib.UseViewBeanTag");
useViewBean__4_1.setPageContext(pageContext);
useViewBean__4_1.setParent(null);
useViewBean__4_1.setClassName("IPP.ipp.pgHelpViewBean");
int useViewBean__4_1_startVal = useViewBean__4_1.doStartTag();
JRunJSPStaticHelpers.checkStartVal
("com.iplanet.jato.taglib.UseViewBeanTag",useViewBean__4_1_startVal,Bo
dyTag.EVAL_BODY_INCLUDE,4);
if(useViewBean__4_1_startVal == BodyTag.EVAL_BODY_INCLUDE) {
com.iplanet.jato.view.ContainerView currentView =
(com.iplanet.jato.view.ContainerView)pageContext.getAttribute
("currentView");
com.iplanet.jato.view.TiledView currentTiledView =
(com.iplanet.jato.view.TiledView)pageContext.getAttribute
("currentTiledView");
out.print("\r\n<HTML>\r\n<HEAD><!--jato:text name=\"stTemp\"
fireDisplayEvents=\"true\" escape=\"true\" /--><!-- Added Temporarily
by ravindran on 8th jan 2001 -->\r\n");
com.iplanet.jato.taglib.TextFieldTag textField__7_1 =
(com.iplanet.jato.taglib.TextFieldTag)
JRunJSPStaticHelpers.createTagHandler(pageContext,
"com.iplanet.jato.taglib.TextFieldTag");
textField__7_1.setPageContext(pageContext);
textField__7_1.setParent(useViewBean__4_1);
textField__7_1.setSize("20");
textField__7_1.setMaxLength("20");
textField__7_1.setFireDisplayEvents("true");
textField__7_1.setName("tbUserID");
textField__7_1.doStartTag();
if(textField__7_1.doEndTag() == Tag.SKIP_PAGE) {
if(true) return;
out.print("\r\n<TITLE>pgHelp</TITLE>\r\n</HEAD>\r\n<body BGCOLOR=
\"white\" bgcolor=\"#FFFFFF\" text=\"#000000\" link=\"#0000FF\" vlink=
\"#800080\" alink=\"#FF0000\">\r\n");
com.iplanet.jato.taglib.FormTag form__11_1 =
(com.iplanet.jato.taglib.FormTag)JRunJSPStaticHelpers.createTagHandler
(pageContext, "com.iplanet.jato.taglib.FormTag");
form__11_1.setPageContext(pageContext);
form__11_1.setParent(useViewBean__4_1);
form__11_1.setMethod("post");
form__11_1.setName("pgHelp");
int form__11_1_startVal = form__11_1.doStartTag();
JRunJSPStaticHelpers.checkStartVal
("com.iplanet.jato.taglib.FormTag",form__11_1_startVal,BodyTag.EVAL_BO
DY_INCLUDE,11);
if(form__11_1_startVal == BodyTag.EVAL_BODY_INCLUDE) {
out.print("\r\n");
if(form__11_1.doEndTag() == Tag.SKIP_PAGE) {
if(true) return;
out.print("\r\n");
com.iplanet.jato.taglib.UseContainerViewTag view__1_1 =
(com.iplanet.jato.taglib.UseContainerViewTag)
JRunJSPStaticHelpers.createTagHandler(pageContext,
"com.iplanet.jato.taglib.UseContainerViewTag");
view__1_1.setPageContext(pageContext);
view__1_1.setParent(null);
view__1_1.setName("IPP.ipp.pgFooterViewBean");
int view__1_1_startVal = view__1_1.doStartTag();
JRunJSPStaticHelpers.checkStartVal
("com.iplanet.jato.taglib.UseContainerViewTag",view__1_1_startVal,Body
Tag.EVAL_BODY_INCLUDE,1);
if(view__1_1_startVal == BodyTag.EVAL_BODY_INCLUDE) {
currentView = (com.iplanet.jato.view.ContainerView)
pageContext.getAttribute("currentView");
currentTiledView = (com.iplanet.jato.view.TiledView)
pageContext.getAttribute("currentTiledView");
com.iplanet.jato.view.ContainerView
IPP.ipp.pgFooterViewBean = (com.iplanet.jato.view.ContainerView)
pageContext.getAttribute("IPP.ipp.pgFooterViewBean");
out.print("\r\n<hr color=red size=2>\r\nfrom new_footer.jsp in
IPP/ipp directory\r\n<font size=\"-2\" face=\"Arial\"><i>Send
comments to <a href=\"mailto:supportdept@a...\">Any
Company</a></i></font>\r\n<hr color=red size=2>\r\n");
com.iplanet.jato.taglib.HiddenTag hidden__6_1 =
(com.iplanet.jato.taglib.HiddenTag)
JRunJSPStaticHelpers.createTagHandler(pageContext,
"com.iplanet.jato.taglib.HiddenTag");
hidden__6_1.setPageContext(pageContext);
hidden__6_1.setParent(view__1_1);
hidden__6_1.setFireDisplayEvents("true");
hidden__6_1.setName("hdFooter");
hidden__6_1.doStartTag();
if(hidden__6_1.doEndTag() == Tag.SKIP_PAGE) {
if(true) return;
out.print("\r\n");
if(view__1_1.doEndTag() == Tag.SKIP_PAGE) {
if(true) return;
out.print("\r\n");
out.print("\r\n</BODY> \r\n</HTML>\r\n");
if(useViewBean__4_1.doEndTag() == Tag.SKIP_PAGE) {
if(true) return;
} catch(Throwable t) {
if(t instanceof ServletException)
throw (ServletException) t;
if(t instanceof java.io.IOException)
throw (java.io.IOException) t;
if(t instanceof RuntimeException)
throw (RuntimeException) t;
throw JRunJSPStaticHelpers.handleException(t,
pageContext);
} finally {
__jspFactory.releasePageContext(pageContext);
public String getServletInfo()
return "pgHelp";
private static final String[] __dependencies__ =
{"/IPP/ipp/pgHelp.jsp",null};
private static final long[] __times__ = {979720473658L,0L};
public String[] __getDependencies()
return __dependencies__;
public long[] __getLastModifiedTimes()
return __times__;
public int __getTranslationVersion()
return 14;
it is generating 2 semicolons automatically..
near pageContext.getAttribute("IPP.ipp.pgFooterViewBean");
regards
ravi
In [email protected], "Mike Frisino" <Michael.Frisino@S...>
wrote:
Hi Suket,
I just retested something very similar to this in 1.0.
Essentially, i took an existing page which included a tiledView.
I moved the TiledView jsp block into an entirely separate jsp file.
I then replace the TiledView jsp block in the original jsp with aninclude
<%@ include file="TiledGetOrders.jsp"%>
It worked like a charm.
So I am not sure what is wrong in your case.
Could be a jrun bug?
I have tested in resin 1.2.1
To do proper analysis, we would need to see
1. The intermediary .java file that the jsp engine creates, andthen tries
to compile.
C:/Program
Files/Allaire/JRun/servers/default/ipp/WEB-INF/jsp/jrun__IPP__ipp__pgHelp2ej
sp.java
Can you send that to us?
Incidentally, although we do not think a problem there would causethe
compile time error you are seeing,
i am curious about your file value.
<%@ include file="/IPP/ipp/pgFooter.jsp"%>I did not need to use a qualified file name, although my includetarget file
was in the same directory as the
page that was including it. What is the file system relationshipbetween
your top level page "pgHelp" and the include
target "pgFooter".
Are they in same or diff directories?
----- Original Message -----
From: <suket@u...>
Sent: Tuesday, January 16, 2001 9:42 PM
Subject: [iPlanet-JATO] Re: include jsp tags
Hi,
We tried to follow the steps described by you to have
dynamic include in a jsp page.
my jsp file content is
<%@p... info="pgHelp" language="java"%>
<%@t... uri="/WEB-INF/jato.tld" prefix="jato"%>
<jsp:useBean id="viewBean" class="IPP.ipp.pgHelpViewBean"
scope="request"></jsp:useBean>
<jato:useViewBean className="IPP.ipp.pgHelpViewBean">
<HTML>
<HEAD>
<jato:textField name="tbUserID" size="20" maxLength="20"
fireDisplayEvents="true" />
<TITLE>pgHelp</TITLE>
</HEAD>
<body BGCOLOR="white" bgcolor="#FFFFFF" text="#000000"
link="#0000FF" vlink="#800080" alink="#FF0000">
<jato:form name="pgHelp" method="post">
</jato:form>
<%@ include file="/IPP/ipp/pgFooter.jsp"%>
</BODY>
</HTML>
</jato:useViewBean>
This is my pgFooter.jsp
<jato:view name="IPP.ipp.pgFooterViewBean">
<hr color=red size=2>
from new_footer.jsp in IPP/ipp directory
<font size="-2" face="Arial"><i>Send comments to <a
href="mailto:<a href="/group/SunONE-JATO/post?protectID=061075104115193209050223163176249165134048139046">supportdept@a...</a>">Any Company</a></i></font>
<hr color=red size=2>
<jato:hidden name="hdFooter" fireDisplayEvents="true" />
</jato:view>
There is no compilation error in pgFooterViewBean and in
pgHelpViewBean.
How ever iam getting a runtime error,
500 Internal Server Error
/ipp/servlet/IPP.ipp.ippServlet:
javax.servlet.ServletException: Compilation error occured:
allaire.jrun.scripting.DefaultCFE:
Errors reported by compiler:C:/Program
Files/Allaire/JRun/servers/default/ipp/WEB-
INF/jsp/jrun__IPP__ipp__pgHelp2ejsp13.java:105:50:105:50: Syntax:
expected instead of this token
What could be the reason for this error message?
We tried the same thing with another approach, instead of using
include directive, we directly copied the code of pgFooter.jsp in
pghelp.jsp.
even that is giving the same error..
<%@p... info="pgHelp" language="java"%>
<%@t... uri="/WEB-INF/jato.tld" prefix="jato"%>
<jsp:useBean id="viewBean" class="IPP.ipp.pgHelpViewBean"
scope="request"></jsp:useBean>
<jato:useViewBean className="IPP.ipp.pgHelpViewBean">
<HTML>
<HEAD>
<jato:textField name="tbUserID" size="20" maxLength="20"
fireDisplayEvents="true" />
<TITLE>pgHelp</TITLE>
</HEAD>
<body BGCOLOR="white" bgcolor="#FFFFFF" text="#000000"
link="#0000FF" vlink="#800080" alink="#FF0000">
<jato:form name="pgHelp" method="post">
</jato:form>
<jato:view name="IPP.ipp.pgFooterViewBean">
<hr color=red size=2>
from new_footer.jsp in IPP/ipp directory
<font size="-2" face="Arial"><i>Send comments to <a
href="mailto:<a href="/group/SunONE-JATO/post?protectID=061075104115193209050223163176249165134048139046">supportdept@a...</a>">Any Company</a></i></font>
<hr color=red size=2>
<jato:hidden name="hdFooter" fireDisplayEvents="true" />
</jato:view>
</BODY>
</HTML>
</jato:useViewBean>
Please give us a feasible solution to solve this problem.
Thx
Ravi
--- In [email protected], "Todd Fast" <Todd.Fast@S...>wrote:
Craig & Eric--
(If you're not interested in the resolution to the problem Craigposted,
please skip ahead to the section in which I describe the
preferred
technique
for including headers and other common content in a JATO page.
This
discussion is very important because I introduce the concept of"view
compostion", in which JATO pages are composed of modular andreusable view
components. This is one of the most powerful new features of
JATO,
and a
capability that simply wasn't possible in NetDynamics.)
Posted Problem Resolution
Craig & Eric, from what I can tell, you are both trying to
include
a full
view bean in a parent page at translation time. This is notpossible, as
you can see from the compiler errors you get. There are
collisions
when
multiple top-level tags are included in the same JSP.
When I said earlier that you needed to use a translation-timeinclude
instead of a run-time include, I was assuming that you were
trying
to
include a fragment of HTML/JSP in the parent page. By
fragment, I
mean HTML
or JSP content that does not declare a view bean or form, but
rather
references views contained within the parent view bean. If youwant to
include a full page (JSP + ViewBean) in another page, then you'dneed to use
a run-time include. A run-time include temporarily pauses therendering of
the current page, and sends the full request to the included
page
as if it
were a separate client request. The resulting content from theincluded
page is inlined into the parent page's content, and processing
of
the parent
page then continues.
Now I realize after thinking about it a bit that we may not have
sufficiently provided for full page includes because of some
late-
breaking
changes in the request context handling. After some basic
testing,
it
appears that if you try to include one JATO page in another byreferencing
the JSP, the included page will cause a class cast exception tooccur.
There may also be problems because the request context on theincluded page
will not have been set. In any case, full JATO page inclusionlooks like
it's an issue we're going to have to address with some fixes
before
it will
work properly. My apologies. (One workaround if this is
necessary
is to
make the included view bean a child view of the parent view
bean.
I won't
go into that however).
How to Include Common Content
Now, on to the discussion of the preferred way of including
common
content
in a JATO page. Let's say you have a common header you want toinclude in
one or more of your JATO pages. Because of the issue I notedabove, and the
fact that the header is not really independently displayable,
you
don't want
to do a run-time include (which, remember, would necessitateincluding a
full JATO page).
Instead, you should include the header as an HTML/JSP fragmentusing a
translation-time include. Depending on whether your header hasdynamic
information, you can do one of two things. If the header is
just
static
content and/or set of links, you can just reference the HTMLfragment in the
parent HTML directly, and you won't need any kind of view or
view
bean to
back it, or any reference to anything in JATO.
If you need some dynamic info in the header, like the module URLfor a link,
you can reference the parent page's view bean for this
information
by simply
including references to the parent page's implicit JSP variables(viewBean,
currentVIew, and currentTiledView). For example:
Parent JSP:
<jsp:useBean id="viewBean" class="..."scope="request"></jsp:useBean>
<jato:useViewBean className="..." fireChildDisplayEvents="true">
<%@ include file="MyInclude.jsp" %>
</jato:useViewBean>
Included content (MyInclude.jsp):
... viewBean.getRequestContext().getModuleURL() ...
The final HTML with the included content would then look like
this:
<jsp:useBean id="viewBean" class="..."scope="request"></jsp:useBean>
<jato:useViewBean className="..." fireChildDisplayEvents="true">
... viewBean.getRequestContext().getModuleURL() ...
</jato:useViewBean>
MyInclude.jsp will be inlined in the parent JSP before it istranslated to a
servlet. Note that it does not include the full HTML tags
normally
found in
an HTML file--there are no <html>, <head>, or <body> tags
because
it is not
expected to be used outside of an include page. In effect,
this is
the
equivalent of a server-side include (SSI).
Now, if you need truly dynamic info in the header, like say youwant to
display the user's name and SSN, then you'd likely want to
embed a
child
view in the parent view bean which will encapsulate & provide
the
necessary
information. This is in contrast to actually making these
fields
direct
children of the the parent view bean, which would be a tedious
and
error
prone task on every page you wanted to include this information.Let me try
to contrast these two approaches with a diagram of parent-child
relationships:
Here's the bad way:
ParentViewBean (ViewBean)
|
+-- UserFirstName (StaticTextField)
|
+-- UserSSN (StaticTextField)
In this situation, you'd need to provide the logic to populatethese fields
in every view bean on which they appeared. This is tedious andessentially
eliminates the "common"-ness of the content (this is also whatNetDynamics
forced people to do).
Now, the better way:
ParentViewBean (ViewBean)
|
+-- MyHeaderView (MyHeaderView.java)
|
+-- UserFirstName (StaticTextField)
|
+-- UserSSN (StaticTextField)
In the better way, you can see that the header information isencapsulated
in an instance of "MyHeaderView", which is a subclass ofContainerViewBase
or one of the other ContainerView subtypes. The population of
the
data
fields is encapsulated in that view, and the parent view need
not
know
anything about what's actually being displayed by that view.
Thus, you can see that MyHeaderView, in conjunction with a
snippet
of JSP
content in a companion file, is completely modular and can beembedded in
any parent view bean on which you want the header to appear.
The
only
requirement is then to include MyHeaderView as a child view of
the
parent
view bean, and to include the correct JSP content that
references
that child
view.
The included JSP content would now look something like this:
<jato:view name="MyHeaderView">
<table>
<tr><td>... <jato:staticText name="UserFirstName"/>
...</td></tr>
<tr><td>... <jato:staticText name="UserSSN"/> ...</td></tr>
</table>
</jato:view>
If we now included this content in the parent JSP from furtherabove, we get
the following as the JSP content before it is translated into aservlet:
<jsp:useBean id="viewBean" class="..."scope="request"></jsp:useBean>
<jato:useViewBean className="..." fireChildDisplayEvents="true">
<jato:view name="MyHeaderView">
<table>
<tr><td>... <jato:staticText name="UserFirstName"/>
...</td></tr>
<tr><td>... <jato:staticText name="UserSSN"/> ...</td></tr>
</table>
</jato:view>
</jato:useViewBean>
Ultimately, this technique is called "view compostion" or "view
aggregation", and is one of the major new features of JATO. Youcan now
define reusable view components and embed them in multiple viewcontainers,
on the same page or on different pages. Each page acts as a
frame,
in which
you provide the contents from modular components. Using thistechnique, you
can develop reusable view classes and chunks of JSP that can bearbitrarily
combined into complex pages.
I know this is a long and rambling discussion, but I hope I've
made
myself
at least partly clear. I'm more than happy to clarify anything
or
elaborate
more. Please let me know.
Todd
Todd Fast
Senior Engineer
Sun/Netscape Alliance
todd.fast@e...
[email protected]
[email protected] -
WindowsDesktopSSO fail-through to LDAP authentication
Hello, all.
I am setting up a WindowsDesktopSSO module and Auth Chain in Access Manager 7.1 (patch -04) under Sun Web Server 7.0u8. AM is currently a single instance intended to expand to a clustered installation, already "load-balanced" by another Sun Web Server 7.0u8.
The Desktop SSO module per se works after some magic and lots of forum and doc reading, and Auth-Chaining does work for enabled browsers when the AD user is not recognized by Access Manager (the actual portal/messaging user database is in Sun DSEE and not all users from AD have equivalent accounts in DSEE - no ISW yet).
However we have a problem with browsers which don't support SPNEGO (or have not enabled it for the domain).
Such browsers receive the HTTP-401 "Unauthorized" page from the web server (apparently, a compiled-in resource template from SWS7) and do not fall through to "LDAP" module which is next in chain for alternate authentication method, after "winsso" module.
This question has been raised and apparently solved in threads below, however no recipe was given and I'm at loss to invent it.
- http://forums.sun.com/thread.jspa?threadID=5336332
- http://forums.sun.com/thread.jspa?threadID=5361015
I have tried to add an "error-page" block to amserver/WEB-INF/web.xml and reference a custom HTML file with the HTTP-401 error text template.
- http://www.adobepress.com/articles/article.asp?p=25445&seqNum=4
<web-app>
<display-name>Access Manager Services</display-name>
<error-page>
<error-code>401</error-code>
<location>/401.html</location>
</error-page>
<distributable/>
<context-param>
...The HTML bage essentially contains a META REFRESH tag to redirect a non-enabled browser to ldapService, and a custom comment for the visitor:
<HTML><HEAD><TITLE>HTTP-401: Unauthorized</TITLE>
<meta HTTP-EQUIV="refresh" content="0;url=/amserver/UI/Login?service=ldapService">
</HEAD>
<BODY>...</BODY>However, when I set this up, such HTTP-401 handler completely overrides the Access Manager logic. Specifically, the HTTP header "WWW-Authenticate:Negotiate" is not set, so ANY browser is redirected to the LDAP service, and Desktop SSO never takes place.
I have also tried to tweak the amserver/config/default/WindowsDesktopSSO.xml file and its clones all around so that the page would render with a JSP template which prints the same content. However, I must be doing something incorrectly - the content is not returned to the browser, and SWS7 default 401 error HTML is printed.
- Customizing module per doc: http://docs.sun.com/app/docs/doc/820-3748/adueu?a=view
I think I can use the web.xml solution to point to a custom JSP which sets all needed HTTP headers (have to try that though), however I hoped for a cleaner solution of just setting a custom template for the HTML part of the message.
Thanks for any ideas,
//Jim Klimov
Edited by: JimKlimov on Jul 5, 2010 6:18 PM
tags/formatting fixedAn update to the "401.jsp" page. Original code did redirect, but only with a fixed URL.
For example, it ignored "goto" parameters for autologin to Messaging Server or Portal upon successful authentication (via LDAPService).
Here's an updated variant which tries to pass-through all provided request parameters:
<%@ page import="java.io.*"%>
<%@ page import="java.util.*"%>
<%@ page import="javax.servlet.*"%>
<%@ page import="javax.servlet.http.*"%>
<%@ page import="javax.servlet.ServletContext"%>
<%@taglib uri="/WEB-INF/jato.tld" prefix="jato"%>
<%@taglib uri="/WEB-INF/auth.tld" prefix="auth"%>
<%
*(C) 2010 Jim Klimov, JSC COS&HT
*param processing (C) http://www.apl.jhu.edu/~hall/java/Servlet-Tutorial/Servlet-Tutorial-Form-Data.html
response.setStatus (response.SC_UNAUTHORIZED);
response.setHeader ("WWW-Authenticate", "Negotiate");
* Default ORG and MODULE/SERVICE values, should override whatever
* was passed to the Login page, if fallback redirect is required
* TODO: Parametrize via serice/property configs
String FallbackServiceURI = "/amserver/UI/Login?service=ldapService&org=defaultRealmName";
%>
<HTML><HEAD><TITLE>HTTP-401: Unauthorized</TITLE>
<%
Enumeration paramNames = request.getParameterNames();
while(paramNames.hasMoreElements()) {
String paramName = (String)paramNames.nextElement();
if (
paramName.equals("service") ||
paramName.equals("module") ||
paramName.equals("org")
) { ; } else {
String[] paramValues = request.getParameterValues(paramName);
for(int i=0; i<paramValues.length; i++) {
String paramValue = paramValues;
FallbackServiceURI += "&"+paramName;
if (paramValue.length() != 0) {
FallbackServiceURI += "="+paramValue;
%>
<meta HTTP-EQUIV="refresh" content="0;url=<%= FallbackServiceURI %>">
</HEAD>
<BODY><H1>HTTP-401: Unauthorized</H1>
Proper authorization is required for this area.
Either your browser does not perform authorization,
or your authorization has failed.<br>
Your browser will be redirected to
<a href="<%= FallbackServiceURI %>">default
authorization method</a>.
</BODY></HTML>
Note that this variant falls back to the "defaultRealmName" organization. If that's not desired, take it out of default FallbackServiceURI and paramName.equals("org") checks.
HTH,
//Jim -
I am running IAS 6.5 on Solaris 8.
When I start the server, I keep seeing this error repeatedly in the kjs_1_CCS0 log file:
java.lang.RuntimeException: Could not initialize server for transaction
service. Possible cause could be another instance of the server already
running.
at com.iplanet.ias.transaction.jts.ORBManager.createORB(Unknown
Source)
at com.iplanet.ias.transaction.jts.ORBManager.getORB(Unknown
Source)
at com.iplanet.ias.transaction.GlobalTxMgr.<init>(Unknown
Source)
at com.kivasoft.txnmgr.TxnMgrModule.init(Unknown Source)
at com.kivasoft.util.Util.loadComponent(Unknown Source)
at com.kivasoft.engine.Engine.initDLMs(Unknown Source)
at com.kivasoft.engine.Engine.run(Unknown Source)
at com.kivasoft.engine.Engine.main(Unknown Source)
Exception in thread "main" java.lang.NullPointerException
at com.iplanet.ias.transaction.GlobalTxMgr.<init>(Unknown
Source)
at com.kivasoft.txnmgr.TxnMgrModule.init(Unknown Source)
at com.kivasoft.util.Util.loadComponent(Unknown Source)
at com.kivasoft.engine.Engine.initDLMs(Unknown Source)
at com.kivasoft.engine.Engine.run(Unknown Source)
at com.kivasoft.engine.Engine.main(Unknown Source)
I checked and there were no kas specific processes running (I killed all
processes and their parents after looking for all processes using
ps -elf | grep k.s ).
This error results in the same NullPointerException as above when trying to associate a transaction with any subsequent bean method call, and consequently i can not execute any transactional methods.
Any ideas??
Thanks.Um, 6.5 hasn't been released yet. (Although based on the exception you are getting, you are definately running 6.5) It also looks like the problem is very 6.5 specific.
So you must be running a beta copy that you've gotten somewhere. I'd suggest:
* Contacting your beta program contact.
* Getting a newer copy of the beta. Obviously a lot of development has been going on.
* Shutting down the server and then checking the transactions tab of ksvradmin. There may be some unresolved transactions out there causing a problem.
I'll experiment a little bit with my beta copy of 6.5 to see if I can come up with some more advice.
But the long and the short of it is that when you are running beta software, the web forums probably aren't the best source of information. No one else here, other than Sun employees, is going to know anything about the exception you are getting. -
Re: [iPlanet-JATO] Re: Retrieving all Values from a Tiled View
Todd,
Let me try to explain you this time. I have a text field in a TiledViewBean.
When I display the page, the text field
html tag is created with the name="PageDetail.rDetail[0].tbFieldName" say
five times/rows with same name.
The html tags look like this.
<input type=text name="PageDetail.rDetail[0].tbFieldName" value=""
maxlength=9 size=13>
<input type=text name="PageDetail.rDetail[0].tbFieldName" value=""
maxlength=9 size=13>
<input type=text name="PageDetail.rDetail[0].tbFieldName" value=""
maxlength=9 size=13>
When the form is submitted, I want to get the text field values using the
method getTbFieldName().getValues() which
returns an array object[]. This is in case where my TiledViewBean is not
bound and it is working fine.
Now in case when my TiledView is bound to a model, it creates the html tags
as follows.
<input type=text name="PageDetail.rDetail[0].tbFieldName" value=""
maxlength=9 size=13>
<input type=text name="PageDetail.rDetail[1].tbFieldName" value=""
maxlength=9 size=13>
<input type=text name="PageDetail.rDetail[2].tbFieldName" value=""
maxlength=9 size=13>
Now when I say getTbFieldName().getValues() it returns only the first
element values in the object[] and the rest of the
values are null.
May be we need to create a utility method do get these values from
requestContext.
raju.
----- Original Message -----
From: Todd Fast <toddwork@c...>
Sent: Saturday, July 07, 2001 3:52 AM
Subject: Re: [iPlanet-JATO] Re: Retrieving all Values from a Tiled View
Raju.--
I wanted to know how the getValues() method works the reason being,
when the tiled view is NOT bound to a model, it populates all the
fields with the same name as some thing likeI'm afraid I don't understand your point--can you please clarify? Do you
mean "value" instead of "name"?
What are you trying to do? What behavior are you expecting but notseeing?
>
Without further clarification, I can say that the setValues() methodsNEVER
populates data on multiple rows of a (dataset) model, nor does it affect
multiple fields on the same row. Perhaps what you are seeing is theeffect
of default values. Model that derive from DefaulModel have the ability to
carry forward the values set on the first row to other rows in lieu ofdata
in those other rows. This behavior is for pure convenience and can be
turned off, and it is turned off for the SQL-based models.
Todd
[email protected]Hi,
I wanted to know how the getValues() method works the reason being,
when the tiled view is NOT bound to a model, it populates all the
fields with the same name as some thing like
PageDetail.rDetail[0].tbFieldValue
PageDetail.rDetail[0].tbFieldValue
in which case, the getValues() method works fine.
But in case where the tiled view is bound to a model, it populates
with different field names such as,
PageDetail.rDetail[0].tbFieldValue
PageDetail.rDetail[1].tbFieldValue
in this case, the getValues() doesn't work. Any soultion to this?
We are using Moko 1.1.1.
thanks in advance,
raju.
--- In iPlanet-JATO@y..., "Todd Fast" <toddwork@c...> wrote:
Does anyone know of is there a single method to get all values of a
display
field in a tiled view without having to iterate through all the
values ie
resetTileIndex() / nextTile() approach.
ie Something that returns an Object[] or Vector just like ND returned a
CspVector. I tried using the getValues() methods but that allways returns
a
single element array containing the first element.
(I think now, that method is used for multi selecteable ListBoxes)Actually, no. We can add this in the next patch, but for now, I'd recommend
creating a simple utility method to do the iteration on an arbitrary model
and build the list for you.
Todd -
Re: [iPlanet-JATO] Retrieving all Values from a Tiled View
Does anyone know of is there a single method to get all values of adisplay
field in a tiled view without having to iterate through all the values ie
resetTileIndex() / nextTile() approach.
ie Something that returns an Object[] or Vector just like ND returned a
CspVector. I tried using the getValues() methods but that allways returnsa
single element array containing the first element.
(I think now, that method is used for multi selecteable ListBoxes)Actually, no. We can add this in the next patch, but for now, I'd recommend
creating a simple utility method to do the iteration on an arbitrary model
and build the list for you.
ToddHi,
I wanted to know how the getValues() method works the reason being,
when the tiled view is NOT bound to a model, it populates all the
fields with the same name as some thing like
PageDetail.rDetail[0].tbFieldValue
PageDetail.rDetail[0].tbFieldValue
in which case, the getValues() method works fine.
But in case where the tiled view is bound to a model, it populates
with different field names such as,
PageDetail.rDetail[0].tbFieldValue
PageDetail.rDetail[1].tbFieldValue
in this case, the getValues() doesn't work. Any soultion to this?
We are using Moko 1.1.1.
thanks in advance,
raju.
--- In iPlanet-JATO@y..., "Todd Fast" <toddwork@c...> wrote:
Does anyone know of is there a single method to get all values of a
display
field in a tiled view without having to iterate through all the
values ie
resetTileIndex() / nextTile() approach.
ie Something that returns an Object[] or Vector just like ND returned a
CspVector. I tried using the getValues() methods but that allways returns
a
single element array containing the first element.
(I think now, that method is used for multi selecteable ListBoxes)Actually, no. We can add this in the next patch, but for now, I'd recommend
creating a simple utility method to do the iteration on an arbitrary model
and build the list for you.
Todd -
Re: [iPlanet-JATO] Sorting a resultset
Steve,
Todd will probably address this more, but to set the stage for the discussion,
I will chime in. As per your scenario "say a user wants to resort the results
by some other column" , I think there needs to be some clarification on the
life cycle of the model. You scenario implies that the user sees the data and
then submits a request to sort the data. This implies that the access to the
same data is spread across two HTTP requests.
Unless explicitly or implicitly stored in session, the Model is a per request
object. Therefore, under ordinary circumstances a new instance of Model is
constructed per request and populated as needed. This is done for scalability
reasons. Most applications would not scale properly if all model instances were
kept around in session per user. There is also the issue of data integrity, a
model stored in session may not reflect the current state of the RDBMS from
which the data was previously retrieved, perhaps minutes before. So, the
default action is to instantiate a new model and repopulate that model The
normal solution would be to apply the sort criteria to the data retrieval at
that point.
What I described above is the norm and the default.
If you have compelling reasons to prefer a single retrieval style, you have to
be prepared to store the Model data in session. There are several methods
within the ModelManager class which assist in this regard. You can see them
described in the java doc.
Also bear in mind that the SQLModelBase typically copies the data from the JDBC
result set into JATO specific local storage. This is done because the JDBC
result set is not as flexible as developer needs and requires the JDBC
connection to remain open while it is used.
I suspect that Todd will describe how you can manipulate the underlying JATO
specific local storage to change the order. I just wanted to make sure you
understood the life cycle issues involved and had justification for deviating
from the default.
Also, I'm still waiting for followup on the defaultCommandChild issue - we'd
like to fix it for JATO 1.2.1 if it is a problem and so far your case is the
only one we have heard of.
----- Original Message -----
From: stephen_winer
Sent: Wednesday, December 12, 2001 9:42 AM
Subject: [iPlanet-JATO] Sorting a resultset
If I want to sort a result set (Model) after the search has taken
place (say a user wants to resort the results by some other column),
can this be done without issuing another query? The reason I ask is
that the next() method in the ResultSetModelBase calls synchronizeRow
(), which resets the row, which sounds like a sort done outside of
the SQL would be reverted.
Steve
For more information about JATO, please visit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp
[Non-text portions of this message have been removed]The hidden field was present in the page, but it looked like this:
<input type="hidden" name="jato.defaultCommand" value=""../search"">
Seems like there is a small bug in the code generating this tag.
FYI - I am using JATO1.2
What file displays this text? Maybe I can go in and fix it and rejar
it.
Steve
--- Mike Frisino wrote:
Steve,
Can you check the HTML source that shows up in the browser? Do you see an entry that looks like this at the bottom of the form in
question?
>
<input type="hidden" name="jato.defaultCommand" value="/search">
To answer your question - it should work as you described. Some of the JatoSample make use of the defaultCommandChild. Can you try
running the sample BasicSample->Field Types and let us know what you
see.
>
Failing this you can send me your jsp file , maybe there is some subtle issue there. michael.frisino@s...
>
>
----- Original Message -----
From: stephen_winer
Sent: Friday, December 07, 2001 8:05 AM
Subject: [iPlanet-JATO] Using the defaultCommandChild in a form
I am trying to set the defaultCommandChild in my jato:form tag to be
the searcg button. The search button definition is:
<jato:button name="search"/>.
The form tag definition is:
<jato:form name="PendingIA" defaultCommandChild="/search">
Clicking on the search button works fine, but hitting return in one
of the textFields (which submits the form) passes a value of "" to
the createChild method in my viewBean, which throws an error. Why
does this not just work as normal and trigger the handleSearchRequest
() method?
Steve
For more information about JATO, please visit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp
Service.
>
>
>
[Non-text portions of this message have been removed] -
The problem is that you don't know what the target view is until it has
been forwarded to.
Think about it... the request handling view bean (or command object) has
the request handler that has the code that will ultimately forward to
another view bean. This is code that you have written. So, until that
forwardTo() is invoked, there is no notion of a "target page".
What you do know is which "page" (view bean) the request is coming from
(the handling view bean or command class). You can get this from the
HttpServletRequest. The attribute name is "viewBean".
So you can get the view bean name by doing the following in onBeforeRequest:
<HttpServletRequest>.getAttribute("viewBean");
But I suspect this is not going to solve your current issue.
You could add the target page name to the page session. If there is more
than one possible target page, it might get a little more involved.
Let me know if the use of page session needs further explanation.
c
nickmalthus wrote:
I am implementing a custom security model since the standard J2EE
security model does not allow me access to the users password, which I
need to log into a third party application. I have overriden the
onBeforeRequest() method to check to see if the user is logged in, and
if not, forward to the Login ViewBean. However, I need to determine
what page/viewbean the request is attempting to access so I can let it
pass through if it is accessing the Login viewbean and to forward to
the requested view once the user is logged in. What is the best way to
do this? I see no obvious uitility in the javadocs
TIA
For more information about JATO, including download information, please visit:
http://developer.iplanet.com/tech/appserver/framework/index.jspI guess what I am thinking about doing is capturing the requested URL,
i.e. /appname/modulename/RequestName. In the onBeforeRequest(). I
would then check to see if the user is logged in, and if not, set the
URL in the session(or page session of the Login bean) and forward to
the Login viewbean using the viewbean manager. Inside the login view
in the handleSubmit() method I would authenticate the user and then
get the URL out of the session (or pagesession). I would then
magically get the ViewBean/Command object for the URL or otherwise
"forward the request" as if the user had typed in
/appname/modulename/RequestName, which is the behavior I am trying to
acheive.
It turns out I cannot forward in the onBeforeRequest() as it will
output the viewbean and then continue to process the request which in
turn trys to do a RequestDispatcher().forward after data has been
written to the stream which does not bode well with the servlet
container. Thus, it appears I have no control of the request in the
onBeforeRequest() method. Is this correct?
In light of this new observation I am now going to create a base view
class that all views will extend from and override the
onSecurityCheck() method to forward to my login bean. If I can't find
any other way, I will get the URL from the page session and do a
response.sendRedirect() to the URL.
Thanks for the help!
--- In iPlanet-JATO@y..., "Craig V. Conover" <craig.conover@s...> wrote:
The problem is that you don't know what the target view is until it has
been forwarded to.
Think about it... the request handling view bean (or command object)has
the request handler that has the code that will ultimately forward to
another view bean. This is code that you have written. So, until that
forwardTo() is invoked, there is no notion of a "target page".
What you do know is which "page" (view bean) the request is coming from
(the handling view bean or command class). You can get this from the
HttpServletRequest. The attribute name is "viewBean".
So you can get the view bean name by doing the following inonBeforeRequest:
>
<HttpServletRequest>.getAttribute("viewBean");
But I suspect this is not going to solve your current issue.
You could add the target page name to the page session. If there ismore
than one possible target page, it might get a little more involved.
Let me know if the use of page session needs further explanation.
c -
If you want to stop a JATO request in its tracks, you have a little black
magic at your disposal: you can throw a CompleteRequestException. This
indicates to the JATO infrastructure that it should immeditately stop
handling the request, but not generate an error, as the develper has taken
full control. You can generally throw this error from anywhere, at any
point--it is a RuntimeException, and is "tunneled" through other exception
handlers where appropriate.
In your scenario, you want to check if the user is logged in, and if not,
save the target URL using the parsePathInfo() method. Then, forward to the
login page and then throw a CompleteRequestException.
Todd
----- Original Message -----
From: "nickmalthus" <nickmalthus@h...>
Sent: Monday, January 07, 2002 3:05 PM
Subject: [iPlanet-JATO] Re: onBeforeRequest(); Finding requested view from
requestContext
I guess what I am thinking about doing is capturing the requested URL,
i.e. /appname/modulename/RequestName. In the onBeforeRequest(). I
would then check to see if the user is logged in, and if not, set the
URL in the session(or page session of the Login bean) and forward to
the Login viewbean using the viewbean manager. Inside the login view
in the handleSubmit() method I would authenticate the user and then
get the URL out of the session (or pagesession). I would then
magically get the ViewBean/Command object for the URL or otherwise
"forward the request" as if the user had typed in
/appname/modulename/RequestName, which is the behavior I am trying to
acheive.
It turns out I cannot forward in the onBeforeRequest() as it will
output the viewbean and then continue to process the request which in
turn trys to do a RequestDispatcher().forward after data has been
written to the stream which does not bode well with the servlet
container. Thus, it appears I have no control of the request in the
onBeforeRequest() method. Is this correct?
In light of this new observation I am now going to create a base view
class that all views will extend from and override the
onSecurityCheck() method to forward to my login bean. If I can't find
any other way, I will get the URL from the page session and do a
response.sendRedirect() to the URL.
Thanks for the help!
--- In iPlanet-JATO@y..., "Craig V. Conover" <craig.conover@s...> wrote:
The problem is that you don't know what the target view is until it has
been forwarded to.
Think about it... the request handling view bean (or command object)has
the request handler that has the code that will ultimately forward to
another view bean. This is code that you have written. So, until that
forwardTo() is invoked, there is no notion of a "target page".
What you do know is which "page" (view bean) the request is coming from
(the handling view bean or command class). You can get this from the
HttpServletRequest. The attribute name is "viewBean".
So you can get the view bean name by doing the following inonBeforeRequest:
<HttpServletRequest>.getAttribute("viewBean");
But I suspect this is not going to solve your current issue.
You could add the target page name to the page session. If there ismore
than one possible target page, it might get a little more involved.
Let me know if the use of page session needs further explanation.
c
For more information about JATO, including download information, pleasevisit:
http://developer.iplanet.com/tech/appserver/framework/index.jspIf you want to stop a JATO request in its tracks, you have a little black
magic at your disposal: you can throw a CompleteRequestException. This
indicates to the JATO infrastructure that it should immeditately stop
handling the request, but not generate an error, as the develper has taken
full control. You can generally throw this error from anywhere, at any
point--it is a RuntimeException, and is "tunneled" through other exception
handlers where appropriate.
In your scenario, you want to check if the user is logged in, and if not,
save the target URL using the parsePathInfo() method. Then, forward to the
login page and then throw a CompleteRequestException.
Todd
----- Original Message -----
From: "nickmalthus" <nickmalthus@h...>
Sent: Monday, January 07, 2002 3:05 PM
Subject: [iPlanet-JATO] Re: onBeforeRequest(); Finding requested view from
requestContext
I guess what I am thinking about doing is capturing the requested URL,
i.e. /appname/modulename/RequestName. In the onBeforeRequest(). I
would then check to see if the user is logged in, and if not, set the
URL in the session(or page session of the Login bean) and forward to
the Login viewbean using the viewbean manager. Inside the login view
in the handleSubmit() method I would authenticate the user and then
get the URL out of the session (or pagesession). I would then
magically get the ViewBean/Command object for the URL or otherwise
"forward the request" as if the user had typed in
/appname/modulename/RequestName, which is the behavior I am trying to
acheive.
It turns out I cannot forward in the onBeforeRequest() as it will
output the viewbean and then continue to process the request which in
turn trys to do a RequestDispatcher().forward after data has been
written to the stream which does not bode well with the servlet
container. Thus, it appears I have no control of the request in the
onBeforeRequest() method. Is this correct?
In light of this new observation I am now going to create a base view
class that all views will extend from and override the
onSecurityCheck() method to forward to my login bean. If I can't find
any other way, I will get the URL from the page session and do a
response.sendRedirect() to the URL.
Thanks for the help!
--- In iPlanet-JATO@y..., "Craig V. Conover" <craig.conover@s...> wrote:
The problem is that you don't know what the target view is until it has
been forwarded to.
Think about it... the request handling view bean (or command object)has
the request handler that has the code that will ultimately forward to
another view bean. This is code that you have written. So, until that
forwardTo() is invoked, there is no notion of a "target page".
What you do know is which "page" (view bean) the request is coming from
(the handling view bean or command class). You can get this from the
HttpServletRequest. The attribute name is "viewBean".
So you can get the view bean name by doing the following inonBeforeRequest:
<HttpServletRequest>.getAttribute("viewBean");
But I suspect this is not going to solve your current issue.
You could add the target page name to the page session. If there ismore
than one possible target page, it might get a little more involved.
Let me know if the use of page session needs further explanation.
c
For more information about JATO, including download information, pleasevisit:
http://developer.iplanet.com/tech/appserver/framework/index.jsp
Maybe you are looking for
-
How to create a ZXP from CS5 throughout CC2014 using ucf.jar
Hi everybody, I use a maven build to generate a ZXP from CS5 throughout CS6 for InDesign. Now, I wish to add CC and CC 2014 to this ZXP, so that I have an universal ZXP for all my supported versions. I use the ucf.jar to generate my current ZXP. I ha
-
Solaris 10 bundle application server
My workstation is SUN Blade 100 Sparc I used solaris 10 bundle appserver and try to start the server. I could create the domain by #asadm create-domain adminport 123 adminuser root mydomain when I delete the domain by #asadm it shows "/usr/bin/imqbro
-
Combining 4 iPods/libraries from different computers on 1 computer
I need help! My wife and I purchased 2 iPod minis some time ago, and I set hers up on her laptop. I set mine up on my work computer. Now our two children have an iPod mini and a nano. I want to move everything (all libraries/songs) to one central com
-
Scroll JTable in Scrollpane with mouse drag
Hello developers ! I'm trying to make a scrollable Jtable. The table have to be scrollable with the mouse drag event. But I have a "flashing" Problem. I can catch the Mouse events from the table (I'm listener the mouse motion and mouse events). When
-
Hi, body: I have Xming installed and I have Putty. My purpose is to open OUI in my local PC by using X window emulator (in this case, Xming) My steps are like: 1. in Putty, SSH=>X11=>Enable X11 forwarding, in X display Location , enter "HOST_NAME"=>c