Re:

2001-06-29 Thread Gordon Reynolds \(Cyonara\)

package com.cyonara.gw.sql;

import com.cyonara.gw.util.*;

import java.sql.Connection;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.sql.DataSource;

public class DataSourceSqlConnector implements SqlConnector
{
   //===/
   //=== Static Data Members ===/
   //===/

   private static final Log fLog =
LogFactory.getInstance(DataSourceSqlConnector.class);

   ///
   //=== Data Members ===/
   ///

   private String fDataSourceName = null;

   ///
   //=== Constructors ===/
   ///

   public DataSourceSqlConnector(
  final String dataSourceName)
   {
  fDataSourceName = dataSourceName;
   }

   //==/
   //=== Public Methods ===/
   //==/

   public Connection getConnection()
   throws
  Exception
   {
  fLog.beginDebug(getConnection());

  Context context = new InitialContext();
  DataSource ds = (DataSource)context.lookup(fDataSourceName);
  Connection result = ds.getConnection();

  fLog.endDebug(getConnection());

  return result;
   }
}
- Original Message -
From: struts orion [EMAIL PROTECTED]
To: Orion-Interest [EMAIL PROTECTED]
Sent: Thursday, June 28, 2001 8:57 PM


 Hi

 I am using oracle thin driver
 the data-source.xml configuration is

 data-source
 class=com.evermind.sql.DriverManagerDataSource
 name=oraclethin
 location=jdbc/Oracle
 connection-driver=oracle.jdbc.driver.OracleDriver
 username=varro
 password=varro
 url=jdbc:oracle:thin:@192.0.0.8:1521:hcp
 inactivity-timeout=30
 /

 How to use/locate this data source in a simple client
 application which uses this datasource and connects to
 database
 If possible give example code for client application

 thanks  regards
 praveen



 __
 Do You Yahoo!?
 Get personalized email addresses from Yahoo! Mail
 http://personal.mail.yahoo.com/







Re: Can't get taglibs to work in orion

2001-06-12 Thread Gordon Reynolds \(Cyonara\)



Tim,

 I think your 
taglib-location should point to a taglib descriptor file instead. 
Following
 is an example fromone of 
myapplications:

 taglib 
taglib-uri/util/taglib-uri 
taglib-locationweb-inf/tlds/tags.tld/taglib-location 
/taglib
 Also note the slash before 
'util' and the absence of the slash before 'web-inf'.

Gordon.

- Original Message - 

  From: 
  Tim Pouyer 
  To: Orion-Interest 
  Sent: Tuesday, June 12, 2001 3:29 
PM
  Subject: Can't get taglibs to work in 
  orion
  
  I downloaded the custom tags provided on orion's 
  site and installed them on my orion 1.5.2 server. But when I try to go 
  to the jsp page that uses them I get a 'page cannot be displayed error'. 
  I can run jsp's that do not utilize orion's taglibs so I think it might have 
  something to do with my deployment descriptors. In my web.xml file in 
  web-inf directory i have the following tags:
  
  
  ?xml version="1.0"?
  !DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 
  2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd"
  web-app
  display-nameHolder Project/display-name
  
  login-config
  auth-methodBASIC/auth-method
  /login-config
  taglib 
  taglib-uriutiltags/taglib-uri
  taglib-location/WEB-INF/lib/utiltags.jar/taglib-location 
  
  /taglib 
  
  /web-app
  and I put %@ taglib uri="utiltags" 
  prefix="util" % at the top of my jsp.With all subsequent code 
  referenced like this util:sometag
  if someone could please explain what I am doing wrong I 
  would greatly appreciate it.


Re: NT Security Integration?

2001-06-08 Thread Gordon Reynolds \(Cyonara\)

No, but I hope someone has. I can tell you this much, it'll require 2
things: first writing
native code to access the NT authentication system (I've seen an article on
this sometime
in the last year in one of my many Java magazines), then writing your own
UserManager
to access the native code.

Regards,

Gordon.

- Original Message -
From: Joe Fair [EMAIL PROTECTED]
To: Orion-Interest [EMAIL PROTECTED]
Sent: Thursday, June 07, 2001 10:17 AM
Subject: NT Security Integration?


 Has anyone has integrated Orion user security with NT
 login security?  It sounds like the sort of thing that
 is either really easy or really tough.
 Any leads?
 Thanks,
 Joe

 __
 Do You Yahoo!?
 Get personalized email addresses from Yahoo! Mail - only $35
 a year!  http://personal.mail.yahoo.com/







Re: [EJB/Servlet 1.5.1]Classpath driving me nuts...

2001-05-29 Thread Gordon Reynolds (cyonara)

Steffen,

That's how I read the spec, with one exception: place only *.jar files
in web-inf/lib; place *.class files in web-inf/classes.

I don't do either, however. I build an ear and place all the
jar files in meta-inf/lib.

Regards,

Gordon.

- Original Message -
From: Steffen Stundzig [EMAIL PROTECTED]
To: Orion-Interest [EMAIL PROTECTED]
Sent: Tuesday, May 29, 2001 7:55 AM
Subject: [EJB/Servlet 1.5.1]Classpath driving me nuts...


 Hi,

 I've a 'war' with a servlet. All needed jars and classes for the servlet
 resists under 'WEB-INF/lib' in the war-file, but orion doesn't find it
 automatically.
 My workaround is to build an 'ear' and in the root 'META-INF' I put an
 'orion-application.xml' with an element library which explicitely
 includes the library path.

 The library path is 'the_unpacked_war/WEB-INF/lib'. But IMHO I think that
all
 classes and jars in the WEB-INF/lib directory should by found
automatically by
 the servlet container. Am I wrong? I've overlooked something?

 Regards
 Steffen...

 --
 __
 Steffen Stundzigmailto:[EMAIL PROTECTED]
 SMB GmbHhttp://www.smb-tec.com










Re: unable to configure form-based authentication correctly

2001-05-15 Thread Gordon Reynolds (cyonara)

Humphrey,

I compared your descriptors with the ones I have in my own
app and found just a few differences that might suggest changes you
can try to get this working:

1. I defined the security roles in both application.xml and web.xml,
not web.xml alone.

2. My protected URL is in a subdirectory, so it's: /protected/* rather
than /*. If you really want everything protected, try omitting the
leading
slash and just use *.

3. I don't specify the http methods in the web-resource-collection tag.

4. My security-role-mapping tags in the orion-application.xml are not
nested in the namespace-access tag. Instead, I have them nested directly
under the orion-application tag.

I'm a UserManager of my own design rather than the one that Orion
supplies, but that shouldn't make any difference.

Hope that helps.

Gordon.


- Original Message -
From: Humphrey Sheil [EMAIL PROTECTED]
To: Orion-Interest [EMAIL PROTECTED]
Sent: Monday, May 14, 2001 10:20 AM
Subject: unable to configure form-based authentication correctly


 Hi

 I am unable to achieve a basic goal with orion:  to force form-based
 authentication using the simplest form of authentication (userids and
 passwords stored in principals.xml).

 I have read all the posts on this subject on the mailing list, but to no
 avail.  I also tried the security primer on jollem.com, but the author of
 this primer told me that this tutorial is not yet working.  I also saw the
 posts by Bill Winspure on Fri, 11 May 2001, but the mail archive hasn't
got
 the zip file attached to the mail.

 My application works fine without authentication, so there are no other
 non-security related things affecting this.

 My procedure to add form-based auth.
 

 1.  I add three new attributes to my web.xml:

 !--  attribute 1.  declare the role I want to access my pages --

 security-role
role-namer_user/role-name
 /security-role


 !-- attribute 2.  now tell the container what and how I want
protected --
 !-- note that the role-name attribute matches my security-role attribute
 above --

 security-constraint
   web-resource-collection
  web-resource-nameProtected Area/web-resource-name
  !-- Define the context-relative URL(s) to be protected --
  url-pattern/*/url-pattern
  !-- If you list http methods, only those methods are
protected --
  http-methodDELETE/http-method
  http-methodGET/http-method
  http-methodPOST/http-method
  http-methodPUT/http-method
   /web-resource-collection
   auth-constraint
  !-- Anyone with one of the listed roles may access this area --
  role-namer_user/role-name
   /auth-constraint
 /security-constraint



 !-- attribute 3.  let the container know that I want to use
form-based
 auth., and redirect to login.jsp --
 !-- the form in login.jsp conforms to the servlet 2.2 spec. naming
 conventions --
 login-config
   auth-methodFORM/auth-method
   realm-nameExample Form-Based Authentication Area/realm-name
   form-login-config
 form-login-pagelogin.jsp/form-login-page
 form-error-pageerror.jsp/form-error-page
   /form-login-config
 /login-config


 2.  I edited the principals.xml contained in $ORION_HOME/config to contain
 my user and group:


 group name=g_user/


 user username=testuser password=xxx
 group-membership group=g_user /
 /user


 3.  I built and deployed the application at this point, and started orion
 server (with a fresh application-deployment directory).


 Next, I went to my application sub-directory under
 $ORION_HOME/application-deployments.

 Here I edited orion-application.xml and added two security-role-mapping
 attributes, one each in the read-access and write-access sections as
 follows:


   namespace-access
 read-access
 namespace-resource root=
 security-role-mapping
 name=lt;jndi-user-rolegt;
 group name=administrators /
 /security-role-mapping
 security-role-mapping name=lt;r_usergt;
 group name=g_user /
 /security-role-mapping
 /namespace-resource
 /read-access
 write-access
 namespace-resource root=
 security-role-mapping
 name=lt;jndi-user-rolegt;
 group name=administrators /
 /security-role-mapping
 security-role-mapping name=lt;r_usergt;
 group name=g_user /
 /security-role-mapping
 /namespace-resource
 /write-access


 (notes:  I tried this with and without the lt; gt;.  I also tried adding
 just one 

Re: Standar Template

2001-05-10 Thread Gordon Reynolds (cyonara)


Dan,

Take a look at this article:


http://developer.java.sun.com/developer/technicalArticles/javaserverpages/js
p_templates/

I think it provides a solution you should consider. I've built my own
version of
the taglib (I wanted default values for the parameters) and it works
well.

Regards,

Gordon.

  -Original Message-
  From: Dave Ford [mailto:[EMAIL PROTECTED]]
  Sent: Thursday, May 10, 2001 12:17 PM
  To: Orion-Interest
  Cc: Dan Tharp
  Subject: Standar Template
 
 
  I want to create a web app in which every page on the site
  has a standard
  header along the top and a standard menu along the left edge (a pretty
  standard thing).
 
  I came up with 2 ways of doing this:
 
  1. Use a table tag and jsp:include tags on EVERY page:
 
  table
tr
  tdjsp:include page=standardHeader.jsp//td
/tr
tr
  td colspan=2
  table
tr
  td valign=topjsp:include page=/menu.jsp //td
  td valign=top
   THIS IS WHERE THE PAGE-SPECIFIC CONTENT (i.e. the body)*
  /td
/tr
  /table
  /td
/tr
  /table
 
  2. Invert the above solution to create one master template
  (or controller)
  and have the content page name passed in as a parameter. Here
  would be the
  master template-controller page:
 
  table
tr
  tdjsp:include page=standardHeader.jsp//td
/tr
tr
  td colspan=2
  table
tr
  td valign=topjsp:include page=/menu.jsp //td
  td valign=top
   jsp:include
  page=%=request.getParameter(contentPage)% /*
  /td
/tr
  /table
  /td
/tr
  /table
 
  The key difference between these two architectures are best
  understood by
  looking at the 2 lines with the * at the end. Also, in option
  2, there is
  only one copy of the above code. In option 1, there is one
  copy per content
  page
 
  Q1: Does anyone have any preference between options 1 and 2?
  Q2: Is there a better way of achieving this result?
  Q3: Do either have any negetive drawback I need to consider?
  (I will be
  converting an entire site)
 
  By the way, I'm currently achieving this effect VERY easily
  using good old
  client-side html frames. But due to popular demand, framse must go.
 
  Dave Ford
  Smart Soft - The Java Training Company
  http://www.smart-soft.com