RE: Newbie to struts with a question on text fields

2003-12-01 Thread Witt, Mike (OH35)
Not sure if you are using a form bean or a dynaactionform.  But, specify a
String type field and then validate the string and convert to numeric.

Mike

-Original Message-
From: Nandita Rajagopalan [mailto:[EMAIL PROTECTED]
Sent: Monday, December 01, 2003 1:47 PM
To: [EMAIL PROTECTED]
Subject: Newbie to struts with a question on text fields


Hi,

I have a textbox which is supposed to hold a numeric value - ie the property
corresponds to a numeric datatype in the Action form. If I leave this
textbox empty , I want my validate method to catch it and print an error as
this field is a required field. However, when I leave this text empty, a
value of  0 gets placed in the property's value . 0 is an allowed value and
hence no error gets dumped. How do I get around this problem ?

Thanks.

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

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



RE: newbie about struts and databases

2003-01-07 Thread James Childers
Allow me.

That's a pretty involved question. The best thing you can do for 
yourself as a beginner is pick up a copy of Struts in Action so you 
can have some background on the technology and how it should work. If 
you are new to Java and JSP, I can recommend the WROX Press book JSP 
Web Development, which gives a good overview of Java, JSP, Struts, and 
also gives a simple example application that shows how these 
technologies work together. Both of these books address the subject of 
database access.

-= J

 -Original Message-
 From: miguel angel rojas aquino
 [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, January 07, 2003 3:59 PM
 To: [EMAIL PROTECTED]
 Subject: newbie about struts and databases
 
 
 hi, i'm starting in Struts, and am reading the tutorials in 
 the struts 
 site about building applications with it, and i was thinking 
 if there is 
 any easy tutorial about database access using struts, so i can start 
 more rapidly with it  (and my boss doesn't get mad at me while 
 convincing him to use struts in the new project we are starting ;)
 
 thanks in advance, and best wishes
 
 
 --
 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]




RE: newbie about struts and databases

2003-01-07 Thread Wendy Smoak
 hi, i'm starting in Struts, and am reading the tutorials in the struts 
 site about building applications with it, and i was thinking if there is 
 any easy tutorial about database access using struts, so i can start 
 more rapidly with it  (and my boss doesn't get mad at me while 
 convincing him to use struts in the new project we are starting ;)

Been there... :)  And discovered that there really isn't any database
access using Struts.  Your data access solution shouldn't have anything to
do with Struts.  It should be usable from a Struts Action, from a Swing app,
from a console app, etc.

Personally, I implemented the Data Access Object pattern as shown in the
J2EE Blueprints document.  That may be overkill for a simple app where you
might put JDBC code directly in the Action class.  Or something in between.

The problem with the existing examples is that they have comments such as,
In a real-world application, we wouldn't do this, but for the purposes of
this example...  And nobody ever shows you how you WOULD do it in the real
world, because it's messy and complicated and depends on your data
structures and rules.

So if you haven't determined how you're going to access your database, do
that first, separately, before you try to access your database from Struts.

-- 
Wendy Smoak
Applications Systems Analyst, Sr.
Arizona State University PA Information Resources Management



RE: newbie about struts and databases

2003-01-07 Thread Phase Web and Multimedia
In regards to Wendy's statement:
That may be overkill for a simple app where you might put JDBC code
directly in the Action class.


Simple Applications Grow into Five Headed Monsters:

I just wanted to agree with Wendy and encourage the use of DAO or some sort
of separated database access (DAO,OJB,etc...) even in simple applications.
I develop websites for small to mid-sized businesses. I made the Struts
newbie mistake of placing all my logic/database access in my action
classes. As my simple applications grew I began to see how much I was
tying myself down by making my Actions synonymous with my logic.

To make a long story short. I had a bunch of code buried in my Action
classes that ultimately needed to be shared amongst several web-apps running
on the same server. Early on I had seen the growing complexity of my
simple applications and I began using the DAO pattern to seperate out my
database access (along with implementing some other clever patterns I picked
up round these newsgroups).

In the end I had to take two large chunks of code out of one of my webapps
so that I could share it with several other webapps. I wrote a couple of
main classes that read in some configuration files to perfrom automated data
retrieval with my DAO/logic classes, set up a cron job and wham-o no painful
translation from Action to standalone classes just the sweet ease of a
pattern gone well.

In the end... try to follow the pattern even if it seems overkill... cuz it
has a higher probability of pay off when your app grows a few more heads
than you expected. :-D

I think we all know that story.

Brandon Goodin
Phase Web and Multimedia
P (406) 862-2245
F (406) 862-0354
[EMAIL PROTECTED]
http://www.phase.ws


-Original Message-
From: Wendy Smoak [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 07, 2003 3:16 PM
To: 'Struts Users Mailing List'
Subject: RE: newbie about struts and databases


 hi, i'm starting in Struts, and am reading the tutorials in the struts
 site about building applications with it, and i was thinking if there is
 any easy tutorial about database access using struts, so i can start
 more rapidly with it  (and my boss doesn't get mad at me while
 convincing him to use struts in the new project we are starting ;)

Been there... :)  And discovered that there really isn't any database
access using Struts.  Your data access solution shouldn't have anything to
do with Struts.  It should be usable from a Struts Action, from a Swing app,
from a console app, etc.

Personally, I implemented the Data Access Object pattern as shown in the
J2EE Blueprints document.  That may be overkill for a simple app where you
might put JDBC code directly in the Action class.  Or something in between.

The problem with the existing examples is that they have comments such as,
In a real-world application, we wouldn't do this, but for the purposes of
this example...  And nobody ever shows you how you WOULD do it in the real
world, because it's messy and complicated and depends on your data
structures and rules.

So if you haven't determined how you're going to access your database, do
that first, separately, before you try to access your database from Struts.

--
Wendy Smoak
Applications Systems Analyst, Sr.
Arizona State University PA Information Resources Management


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




thanks a lot (Re: newbie about struts and databases)

2003-01-07 Thread miguel angel rojas aquino
miguel angel rojas aquino wrote:


hi, i'm starting in Struts,


thanks a lot for your responses, it clears the path i need to follow to 
become a good struts user :)


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



RE: Newbie to struts

2002-09-17 Thread Howard Miller

Hi,

I've read this about 5 times now and still can't get my head aroud what you
are doing.

Can you draw us a picture of what directories hold what, what your
classpath is, and what your javac command is.

Personally I have always used the structure recommended in the tomcat
documentation that involves an ant build script, this gets around a lot of
classpath difficulties as it generates the path for you (and it could be
quite lengthy with a STRUTS applicaton).

Don't think that's your problem though.

HM

-Original Message-
From: angela mcgrenra [mailto:[EMAIL PROTECTED]]
Sent: 17 September 2002 09:48
To: [EMAIL PROTECTED]
Subject: Newbie to struts


Hi there

I am working my way thtough a Struts tutorial and have a slight (simple I'm 
sure) problem...

I have a bean (Book.java)saved and compiled in my classes dir at 
tomcat\webapps\strutsShop\WEB_INF\classes

In this folder also is BookAction.java which needs to be able to find this 
bean, and a locally saved copy of the struts.jar file

I have edited struts-config.xml and all other files are ready and waiting 
but my problem is when I try to compile the BookAction.java file in my 
classes dir.

The error I get is
BookAction.java:27: cannot resolve symbol
symbol   : class Book
location : class BookAction
 Book book = new Book();





_
Chat with friends online, try MSN Messenger: http://messenger.msn.com


--
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]




RE: Newbie to struts

2002-09-17 Thread Howard Miller

Hi again,

I'm assuming you are using Tomcat, which may not be the case... this is
still worth a look I think

http://jakarta.apache.org/tomcat/tomcat-4.1-doc/appdev/source.html

Howard

-Original Message-
From: angela mcgrenra [mailto:[EMAIL PROTECTED]]
Sent: 17 September 2002 09:48
To: [EMAIL PROTECTED]
Subject: Newbie to struts


Hi there

I am working my way thtough a Struts tutorial and have a slight (simple I'm 
sure) problem...

I have a bean (Book.java)saved and compiled in my classes dir at 
tomcat\webapps\strutsShop\WEB_INF\classes

In this folder also is BookAction.java which needs to be able to find this 
bean, and a locally saved copy of the struts.jar file

I have edited struts-config.xml and all other files are ready and waiting 
but my problem is when I try to compile the BookAction.java file in my 
classes dir.

The error I get is
BookAction.java:27: cannot resolve symbol
symbol   : class Book
location : class BookAction
 Book book = new Book();





_
Chat with friends online, try MSN Messenger: http://messenger.msn.com


--
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]




RE: Newbie to struts

2002-09-17 Thread angela mcgrenra

OKAY

I have a dir structure as follows

C:\java\jakarta-tomcat-3.3.1\webapps\strutsShop\BookView.jsp
C:\java\jakarta-tomcat-3.3.1\webapps\strutsShop\CreateBook.jsp
C:\java\jakarta-tomcat-3.3.1\webapps\strutsShop\WEB-INF\classes\Book.java
C:\java\jakarta-tomcat-3.3.1\webapps\strutsShop\WEB-INF\classes\BookActoin.java

Code for BookView.jsp is:

%@ page language=java %
%@ taglib uri=/WEB-INF/struts-bean.tld  prefix=bean %
%@ taglib uri=/WEB-INF/struts-html.tld  prefix=html %
%@ taglib uri=/WEB-INF/struts-logic.tld prefix=logic %

html:html locale=true
head
html:base/
title
bean:message key=index.title/
/title
/head

bodyAngela's test page/body
  html:form action=createBook method=GET
Title:html:text property=title / br/
html:submit property=submit/
/html:form
/html:html


Code for CreateBook.jsp is:

%@ page language=java %
%@ taglib uri=/WEB-INF/struts-bean.tld  prefix=bean %
%@ taglib uri=/WEB-INF/struts-html.tld  prefix=html %
%@ taglib uri=/WEB-INF/struts-logic.tld prefix=logic %

html:html locale=true
head
   html:base/
   titlebean:message key=index.title//title
/head
body bgcolor=white
h2Create a book/h2
html:errors/
html:form action=createBook.do method=GET
Title:html:text property=title / br/
html:submit property=submit/
/html:form
/body
/html:html

IN C:\java\jakarta-tomcat-3.3.1\webapps\strutsShop\WEB-INF\classes
I have Book.java (compiles into class file fine)
Code is :

import java.util.Vector;

public class Book
{

private String title = ;
private Vector authors = new Vector();
private int pages = 0;

/** Standard constructor. */
public Book()
{ }

/** @param title The new Title   */
public void setTitle(String title)
{  this.title = title;   }

/** @return The title. */
public String getTitle()
{ return this.title; }

/** @param pages The new number of pages. */
public void setPages(int pages)
{ this.pages = pages; }

/** @return The number of pages. */
public int getPages()
{ return this.pages; }

/**
We don't want to work with the Vector here, as it is
only a reference we would get!
@param author Add another author
*/
public void addAuthor(String author)
{ this.authors.add(author); }


/**
Pay attention not to use the wrong number.
@param position The number of the author to remove.
*/
public void removeAuthor(int position)
{ this.authors.remove(position); }

/** @return The number of authors the book has. */
public int getNumberOfAuthors()
{ return this.authors.size(); }
}

Code for BookAction.java is:

import javax.servlet.http.*;
import org.apache.struts.action.*;


/*
The action for the creation of a book.
@author [EMAIL PROTECTED]
*/
public final class BookAction extends Action
{

/**
  @param mapping The ActionMapping used to select this instance
  @param form The optional ActionForm bean for this request (if any)
  @param req The non-HTTP request we are processing
  @param res The non-HTTP response we are creating
  @return Return an ActionForward instance describing where and how
  control should be forwarded, or null if the response has 
already
  been completed.
*/
public ActionForward perform(ActionMapping mapping,
ActionForm form,  HttpServletRequest req,
HttpServletResponse res)
{
System.out.println(Start perform( + form + ) . . . );
String title = req.getParameter(title);
Book book = new Book();
book.setTitle( title );
System.out.println(After creation of book:  + book.getTitle() 
);

req.setAttribute(BOOK, book);
return mapping.findForward(bookCreated);
}
}

When I try to compile BookAction.java I get my error

BookAction.java:27: cannot resolve symbol
symbol   : class Book
location : class BookAction
  Book book = new Book();

The problem seems to be that BookAction.java cant find struts.jar that I 
have saved locally in my classes directory...

I have saved this path into my CLASSPATH variable but to no avail...




From: Howard Miller [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Subject: RE: Newbie to struts
Date: Tue, 17 Sep 2002 10:12:39 +0100

Hi,

I've read this about 5 times now and still can't get my head aroud what you
are doing.

Can you draw us a picture of what directories hold what, what your
classpath is, and what your javac command is.

Personally I have always used the structure recommended in the tomcat
documentation that involves an ant build script, this gets around a lot of
classpath difficulties as it generates the path for you (and it could be
quite lengthy with a STRUTS applicaton

Re: Newbie to struts

2002-09-17 Thread Kalaiselvan


Verify that Book.java is in same directory as in BookAction.java
Otherwise u must import Book.java in ur BookAction.java
Better u put these two java's into the same package.

Hope it will work.

Kalaiselvan.S

- Original Message -
From: angela mcgrenra [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, September 17, 2002 3:40 PM
Subject: RE: Newbie to struts


 OKAY

 I have a dir structure as follows

 C:\java\jakarta-tomcat-3.3.1\webapps\strutsShop\BookView.jsp
 C:\java\jakarta-tomcat-3.3.1\webapps\strutsShop\CreateBook.jsp
 C:\java\jakarta-tomcat-3.3.1\webapps\strutsShop\WEB-INF\classes\Book.java

C:\java\jakarta-tomcat-3.3.1\webapps\strutsShop\WEB-INF\classes\BookActoin.j
ava

 Code for BookView.jsp is:

 %@ page language=java %
 %@ taglib uri=/WEB-INF/struts-bean.tld  prefix=bean %
 %@ taglib uri=/WEB-INF/struts-html.tld  prefix=html %
 %@ taglib uri=/WEB-INF/struts-logic.tld prefix=logic %

 html:html locale=true
 head
 html:base/
 title
 bean:message key=index.title/
 /title
 /head

 bodyAngela's test page/body
   html:form action=createBook method=GET
 Title:html:text property=title / br/
 html:submit property=submit/
 /html:form
 /html:html


 Code for CreateBook.jsp is:

 %@ page language=java %
 %@ taglib uri=/WEB-INF/struts-bean.tld  prefix=bean %
 %@ taglib uri=/WEB-INF/struts-html.tld  prefix=html %
 %@ taglib uri=/WEB-INF/struts-logic.tld prefix=logic %

 html:html locale=true
 head
html:base/
titlebean:message key=index.title//title
 /head
 body bgcolor=white
 h2Create a book/h2
 html:errors/
 html:form action=createBook.do method=GET
 Title:html:text property=title / br/
 html:submit property=submit/
 /html:form
 /body
 /html:html

 IN C:\java\jakarta-tomcat-3.3.1\webapps\strutsShop\WEB-INF\classes
 I have Book.java (compiles into class file fine)
 Code is :

 import java.util.Vector;

 public class Book
 {

 private String title = ;
 private Vector authors = new Vector();
 private int pages = 0;

 /** Standard constructor. */
 public Book()
 { }

 /** @param title The new Title   */
 public void setTitle(String title)
 {  this.title = title;   }

 /** @return The title. */
 public String getTitle()
 { return this.title; }

 /** @param pages The new number of pages. */
 public void setPages(int pages)
 { this.pages = pages; }

 /** @return The number of pages. */
 public int getPages()
 { return this.pages; }

 /**
 We don't want to work with the Vector here, as it is
 only a reference we would get!
 @param author Add another author
 */
 public void addAuthor(String author)
 { this.authors.add(author); }


 /**
 Pay attention not to use the wrong number.
 @param position The number of the author to remove.
 */
 public void removeAuthor(int position)
 { this.authors.remove(position); }

 /** @return The number of authors the book has. */
 public int getNumberOfAuthors()
 { return this.authors.size(); }
 }

 Code for BookAction.java is:

 import javax.servlet.http.*;
 import org.apache.struts.action.*;


 /*
 The action for the creation of a book.
 @author [EMAIL PROTECTED]
 */
 public final class BookAction extends Action
 {

 /**
   @param mapping The ActionMapping used to select this instance
   @param form The optional ActionForm bean for this request (if
any)
   @param req The non-HTTP request we are processing
   @param res The non-HTTP response we are creating
   @return Return an ActionForward instance describing where and
how
   control should be forwarded, or null if the response has
 already
   been completed.
 */
 public ActionForward perform(ActionMapping mapping,
 ActionForm form,  HttpServletRequest req,
 HttpServletResponse res)
 {
 System.out.println(Start perform( + form + ) . . . );
 String title = req.getParameter(title);
 Book book = new Book();
 book.setTitle( title );
 System.out.println(After creation of book:  +
book.getTitle()
 );

 req.setAttribute(BOOK, book);
 return mapping.findForward(bookCreated);
 }
 }

 When I try to compile BookAction.java I get my error

 BookAction.java:27: cannot resolve symbol
 symbol   : class Book
 location : class BookAction
   Book book = new Book();

 The problem seems to be that BookAction.java cant find struts.jar that I
 have saved locally in my classes directory...

 I have saved this path into my CLASSPATH variable but to no avail...




 From: Howard Miller [EMAIL PROTECTED]
 Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
 To: 'Struts Users Mailing List' [EMAIL PROTECTED]
 Subject: RE: Newbie to struts

RE: Newbie to struts

2002-09-17 Thread Howard Miller

Correct me if I'm wrong, but it seems that the compiler is not finding class
Book, which is (supposed to be) in the same default package as BookAction?
Therefore the problem has nothing to do with struts.jar.

A couple of observations...
Don't use default packages with servlets and suchlike. You get away with it
for a while but then weird things start happening - I found out the hard
way!!
Strongly recommend looking at Tomcat/ant source setup. This has the
advantage of loading your application on-the-fly without creating subdirs of
the tomcat distribution.
Are you using some sort of IDE for this (which might be screwing up the
classpath)?
Is BookActoin.java.. in your file list just a typing error, or is it really
called that? (That would do it!!)

HM

-Original Message-
From: angela mcgrenra [mailto:[EMAIL PROTECTED]]
Sent: 17 September 2002 11:11
To: [EMAIL PROTECTED]
Subject: RE: Newbie to struts


OKAY

I have a dir structure as follows

C:\java\jakarta-tomcat-3.3.1\webapps\strutsShop\BookView.jsp
C:\java\jakarta-tomcat-3.3.1\webapps\strutsShop\CreateBook.jsp
C:\java\jakarta-tomcat-3.3.1\webapps\strutsShop\WEB-INF\classes\Book.java
C:\java\jakarta-tomcat-3.3.1\webapps\strutsShop\WEB-INF\classes\BookActoin.j
ava

Code for BookView.jsp is:

%@ page language=java %
%@ taglib uri=/WEB-INF/struts-bean.tld  prefix=bean %
%@ taglib uri=/WEB-INF/struts-html.tld  prefix=html %
%@ taglib uri=/WEB-INF/struts-logic.tld prefix=logic %

html:html locale=true
head
html:base/
title
bean:message key=index.title/
/title
/head

bodyAngela's test page/body
  html:form action=createBook method=GET
Title:html:text property=title / br/
html:submit property=submit/
/html:form
/html:html


Code for CreateBook.jsp is:

%@ page language=java %
%@ taglib uri=/WEB-INF/struts-bean.tld  prefix=bean %
%@ taglib uri=/WEB-INF/struts-html.tld  prefix=html %
%@ taglib uri=/WEB-INF/struts-logic.tld prefix=logic %

html:html locale=true
head
   html:base/
   titlebean:message key=index.title//title
/head
body bgcolor=white
h2Create a book/h2
html:errors/
html:form action=createBook.do method=GET
Title:html:text property=title / br/
html:submit property=submit/
/html:form
/body
/html:html

IN C:\java\jakarta-tomcat-3.3.1\webapps\strutsShop\WEB-INF\classes
I have Book.java (compiles into class file fine)
Code is :

import java.util.Vector;

public class Book
{

private String title = ;
private Vector authors = new Vector();
private int pages = 0;

/** Standard constructor. */
public Book()
{ }

/** @param title The new Title   */
public void setTitle(String title)
{  this.title = title;   }

/** @return The title. */
public String getTitle()
{ return this.title; }

/** @param pages The new number of pages. */
public void setPages(int pages)
{ this.pages = pages; }

/** @return The number of pages. */
public int getPages()
{ return this.pages; }

/**
We don't want to work with the Vector here, as it is
only a reference we would get!
@param author Add another author
*/
public void addAuthor(String author)
{ this.authors.add(author); }


/**
Pay attention not to use the wrong number.
@param position The number of the author to remove.
*/
public void removeAuthor(int position)
{ this.authors.remove(position); }

/** @return The number of authors the book has. */
public int getNumberOfAuthors()
{ return this.authors.size(); }
}

Code for BookAction.java is:

import javax.servlet.http.*;
import org.apache.struts.action.*;


/*
The action for the creation of a book.
@author [EMAIL PROTECTED]
*/
public final class BookAction extends Action
{

/**
  @param mapping The ActionMapping used to select this instance
  @param form The optional ActionForm bean for this request (if any)
  @param req The non-HTTP request we are processing
  @param res The non-HTTP response we are creating
  @return Return an ActionForward instance describing where and how
  control should be forwarded, or null if the response has 
already
  been completed.
*/
public ActionForward perform(ActionMapping mapping,
ActionForm form,  HttpServletRequest req,
HttpServletResponse res)
{
System.out.println(Start perform( + form + ) . . . );
String title = req.getParameter(title);
Book book = new Book();
book.setTitle( title );
System.out.println(After creation of book:  + book.getTitle() 
);

req.setAttribute(BOOK, book);
return mapping.findForward(bookCreated);
}
}

When I try to compile BookAction.java I get my error

BookAction.java:27: cannot resolve symbol
symbol   : class Book
location : class

Re: Newbie to struts

2002-09-17 Thread Jin Bal

Have you tried putting struts.jar into:
C:\java\jakarta-tomcat-3.3.1\webapps\strutsShop\WEB-INF\lib
?

I might have missed something in your post so forgive me if this is
irrelevant

HTH
Jin

- Original Message -
From: angela mcgrenra [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, September 17, 2002 11:10 AM
Subject: RE: Newbie to struts


 OKAY

 I have a dir structure as follows

 C:\java\jakarta-tomcat-3.3.1\webapps\strutsShop\BookView.jsp
 C:\java\jakarta-tomcat-3.3.1\webapps\strutsShop\CreateBook.jsp
 C:\java\jakarta-tomcat-3.3.1\webapps\strutsShop\WEB-INF\classes\Book.java

C:\java\jakarta-tomcat-3.3.1\webapps\strutsShop\WEB-INF\classes\BookActoin.j
ava

 Code for BookView.jsp is:

 %@ page language=java %
 %@ taglib uri=/WEB-INF/struts-bean.tld  prefix=bean %
 %@ taglib uri=/WEB-INF/struts-html.tld  prefix=html %
 %@ taglib uri=/WEB-INF/struts-logic.tld prefix=logic %

 html:html locale=true
 head
 html:base/
 title
 bean:message key=index.title/
 /title
 /head

 bodyAngela's test page/body
   html:form action=createBook method=GET
 Title:html:text property=title / br/
 html:submit property=submit/
 /html:form
 /html:html


 Code for CreateBook.jsp is:

 %@ page language=java %
 %@ taglib uri=/WEB-INF/struts-bean.tld  prefix=bean %
 %@ taglib uri=/WEB-INF/struts-html.tld  prefix=html %
 %@ taglib uri=/WEB-INF/struts-logic.tld prefix=logic %

 html:html locale=true
 head
html:base/
titlebean:message key=index.title//title
 /head
 body bgcolor=white
 h2Create a book/h2
 html:errors/
 html:form action=createBook.do method=GET
 Title:html:text property=title / br/
 html:submit property=submit/
 /html:form
 /body
 /html:html

 IN C:\java\jakarta-tomcat-3.3.1\webapps\strutsShop\WEB-INF\classes
 I have Book.java (compiles into class file fine)
 Code is :

 import java.util.Vector;

 public class Book
 {

 private String title = ;
 private Vector authors = new Vector();
 private int pages = 0;

 /** Standard constructor. */
 public Book()
 { }

 /** @param title The new Title   */
 public void setTitle(String title)
 {  this.title = title;   }

 /** @return The title. */
 public String getTitle()
 { return this.title; }

 /** @param pages The new number of pages. */
 public void setPages(int pages)
 { this.pages = pages; }

 /** @return The number of pages. */
 public int getPages()
 { return this.pages; }

 /**
 We don't want to work with the Vector here, as it is
 only a reference we would get!
 @param author Add another author
 */
 public void addAuthor(String author)
 { this.authors.add(author); }


 /**
 Pay attention not to use the wrong number.
 @param position The number of the author to remove.
 */
 public void removeAuthor(int position)
 { this.authors.remove(position); }

 /** @return The number of authors the book has. */
 public int getNumberOfAuthors()
 { return this.authors.size(); }
 }

 Code for BookAction.java is:

 import javax.servlet.http.*;
 import org.apache.struts.action.*;


 /*
 The action for the creation of a book.
 @author [EMAIL PROTECTED]
 */
 public final class BookAction extends Action
 {

 /**
   @param mapping The ActionMapping used to select this instance
   @param form The optional ActionForm bean for this request (if
any)
   @param req The non-HTTP request we are processing
   @param res The non-HTTP response we are creating
   @return Return an ActionForward instance describing where and
how
   control should be forwarded, or null if the response has
 already
   been completed.
 */
 public ActionForward perform(ActionMapping mapping,
 ActionForm form,  HttpServletRequest req,
 HttpServletResponse res)
 {
 System.out.println(Start perform( + form + ) . . . );
 String title = req.getParameter(title);
 Book book = new Book();
 book.setTitle( title );
 System.out.println(After creation of book:  +
book.getTitle()
 );

 req.setAttribute(BOOK, book);
 return mapping.findForward(bookCreated);
 }
 }

 When I try to compile BookAction.java I get my error

 BookAction.java:27: cannot resolve symbol
 symbol   : class Book
 location : class BookAction
   Book book = new Book();

 The problem seems to be that BookAction.java cant find struts.jar that I
 have saved locally in my classes directory...

 I have saved this path into my CLASSPATH variable but to no avail...




 From: Howard Miller [EMAIL PROTECTED]
 Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
 To: 'Struts Users Mailing List' [EMAIL PROTECTED]
 Subject: RE: Newbie to struts
 Date: Tue, 17 Sep

RE: Newbie to struts

2002-09-17 Thread Miguel Angel Mulero Martinez

It's a silly answer, but, have you compiled Book before BookAction?

-Mensaje original-
De: angela mcgrenra [mailto:[EMAIL PROTECTED]]
Enviado el: martes, 17 de septiembre de 2002 12:11
Para: [EMAIL PROTECTED]
Asunto: RE: Newbie to struts

OKAY

I have a dir structure as follows

C:\java\jakarta-tomcat-3.3.1\webapps\strutsShop\BookView.jsp
C:\java\jakarta-tomcat-3.3.1\webapps\strutsShop\CreateBook.jsp
C:\java\jakarta-tomcat-3.3.1\webapps\strutsShop\WEB-INF\classes\Book.java
C:\java\jakarta-tomcat-3.3.1\webapps\strutsShop\WEB-INF\classes\BookActoin.j
ava

Code for BookView.jsp is:

%@ page language=java %
%@ taglib uri=/WEB-INF/struts-bean.tld  prefix=bean %
%@ taglib uri=/WEB-INF/struts-html.tld  prefix=html %
%@ taglib uri=/WEB-INF/struts-logic.tld prefix=logic %

html:html locale=true
head
html:base/
title
bean:message key=index.title/
/title
/head

bodyAngela's test page/body
  html:form action=createBook method=GET
Title:html:text property=title / br/
html:submit property=submit/
/html:form
/html:html


Code for CreateBook.jsp is:

%@ page language=java %
%@ taglib uri=/WEB-INF/struts-bean.tld  prefix=bean %
%@ taglib uri=/WEB-INF/struts-html.tld  prefix=html %
%@ taglib uri=/WEB-INF/struts-logic.tld prefix=logic %

html:html locale=true
head
   html:base/
   titlebean:message key=index.title//title
/head
body bgcolor=white
h2Create a book/h2
html:errors/
html:form action=createBook.do method=GET
Title:html:text property=title / br/
html:submit property=submit/
/html:form
/body
/html:html

IN C:\java\jakarta-tomcat-3.3.1\webapps\strutsShop\WEB-INF\classes
I have Book.java (compiles into class file fine)
Code is :

import java.util.Vector;

public class Book
{

private String title = ;
private Vector authors = new Vector();
private int pages = 0;

/** Standard constructor. */
public Book()
{ }

/** @param title The new Title   */
public void setTitle(String title)
{  this.title = title;   }

/** @return The title. */
public String getTitle()
{ return this.title; }

/** @param pages The new number of pages. */
public void setPages(int pages)
{ this.pages = pages; }

/** @return The number of pages. */
public int getPages()
{ return this.pages; }

/**
We don't want to work with the Vector here, as it is
only a reference we would get!
@param author Add another author
*/
public void addAuthor(String author)
{ this.authors.add(author); }


/**
Pay attention not to use the wrong number.
@param position The number of the author to remove.
*/
public void removeAuthor(int position)
{ this.authors.remove(position); }

/** @return The number of authors the book has. */
public int getNumberOfAuthors()
{ return this.authors.size(); }
}

Code for BookAction.java is:

import javax.servlet.http.*;
import org.apache.struts.action.*;


/*
The action for the creation of a book.
@author [EMAIL PROTECTED]
*/
public final class BookAction extends Action
{

/**
  @param mapping The ActionMapping used to select this instance
  @param form The optional ActionForm bean for this request (if any)
  @param req The non-HTTP request we are processing
  @param res The non-HTTP response we are creating
  @return Return an ActionForward instance describing where and how
  control should be forwarded, or null if the response has
already
  been completed.
*/
public ActionForward perform(ActionMapping mapping,
ActionForm form,  HttpServletRequest req,
HttpServletResponse res)
{
System.out.println(Start perform( + form + ) . . . );
String title = req.getParameter(title);
Book book = new Book();
book.setTitle( title );
System.out.println(After creation of book:  + book.getTitle()
);

req.setAttribute(BOOK, book);
return mapping.findForward(bookCreated);
}
}

When I try to compile BookAction.java I get my error

BookAction.java:27: cannot resolve symbol
symbol   : class Book
location : class BookAction
  Book book = new Book();

The problem seems to be that BookAction.java cant find struts.jar that I
have saved locally in my classes directory...

I have saved this path into my CLASSPATH variable but to no avail...




From: Howard Miller [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Subject: RE: Newbie to struts
Date: Tue, 17 Sep 2002 10:12:39 +0100

Hi,

I've read this about 5 times now and still can't get my head aroud what you
are doing.

Can you draw us a picture of what directories hold what, what your
classpath is, and what your javac command is.

Personally I

RE: Newbie to struts

2002-09-17 Thread angela mcgrenra

Got it sorted - u were right Howard, had nothing to do with struts.jar.

I added the path to the classes directory to the javac command and it 
compiled ok...not the way to go though!

Thanks for all your help

Angie


From: Howard Miller [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Subject: RE: Newbie to struts
Date: Tue, 17 Sep 2002 11:28:21 +0100

Correct me if I'm wrong, but it seems that the compiler is not finding 
class
Book, which is (supposed to be) in the same default package as BookAction?
Therefore the problem has nothing to do with struts.jar.

A couple of observations...
Don't use default packages with servlets and suchlike. You get away with it
for a while but then weird things start happening - I found out the hard
way!!
Strongly recommend looking at Tomcat/ant source setup. This has the
advantage of loading your application on-the-fly without creating subdirs 
of
the tomcat distribution.
Are you using some sort of IDE for this (which might be screwing up the
classpath)?
Is BookActoin.java.. in your file list just a typing error, or is it really
called that? (That would do it!!)

HM

-Original Message-
From: angela mcgrenra [mailto:[EMAIL PROTECTED]]
Sent: 17 September 2002 11:11
To: [EMAIL PROTECTED]
Subject: RE: Newbie to struts


OKAY

I have a dir structure as follows

C:\java\jakarta-tomcat-3.3.1\webapps\strutsShop\BookView.jsp
C:\java\jakarta-tomcat-3.3.1\webapps\strutsShop\CreateBook.jsp
C:\java\jakarta-tomcat-3.3.1\webapps\strutsShop\WEB-INF\classes\Book.java
C:\java\jakarta-tomcat-3.3.1\webapps\strutsShop\WEB-INF\classes\BookActoin.j
ava

Code for BookView.jsp is:

%@ page language=java %
 %@ taglib uri=/WEB-INF/struts-bean.tld  prefix=bean %
 %@ taglib uri=/WEB-INF/struts-html.tld  prefix=html %
 %@ taglib uri=/WEB-INF/struts-logic.tld prefix=logic %

 html:html locale=true
 head
 html:base/
 title
 bean:message key=index.title/
 /title
 /head

 bodyAngela's test page/body
   html:form action=createBook method=GET
 Title:html:text property=title / br/
 html:submit property=submit/
 /html:form
 /html:html


Code for CreateBook.jsp is:

%@ page language=java %
%@ taglib uri=/WEB-INF/struts-bean.tld  prefix=bean %
%@ taglib uri=/WEB-INF/struts-html.tld  prefix=html %
%@ taglib uri=/WEB-INF/struts-logic.tld prefix=logic %

html:html locale=true
head
html:base/
titlebean:message key=index.title//title
/head
body bgcolor=white
h2Create a book/h2
html:errors/
html:form action=createBook.do method=GET
 Title:html:text property=title / br/
 html:submit property=submit/
/html:form
/body
/html:html

IN C:\java\jakarta-tomcat-3.3.1\webapps\strutsShop\WEB-INF\classes
I have Book.java (compiles into class file fine)
Code is :

import java.util.Vector;

public class Book
{

 private String title = ;
 private Vector authors = new Vector();
 private int pages = 0;

 /** Standard constructor. */
 public Book()
 { }

 /** @param title The new Title   */
 public void setTitle(String title)
 {  this.title = title;   }

 /** @return The title. */
 public String getTitle()
 { return this.title; }

 /** @param pages The new number of pages. */
 public void setPages(int pages)
 { this.pages = pages; }

 /** @return The number of pages. */
 public int getPages()
 { return this.pages; }

 /**
 We don't want to work with the Vector here, as it is
 only a reference we would get!
 @param author Add another author
 */
 public void addAuthor(String author)
 { this.authors.add(author); }


 /**
 Pay attention not to use the wrong number.
 @param position The number of the author to remove.
 */
 public void removeAuthor(int position)
 { this.authors.remove(position); }

 /** @return The number of authors the book has. */
 public int getNumberOfAuthors()
 { return this.authors.size(); }
}

Code for BookAction.java is:

import javax.servlet.http.*;
import org.apache.struts.action.*;


 /*
 The action for the creation of a book.
 @author [EMAIL PROTECTED]
 */
 public final class BookAction extends Action
 {

 /**
   @param mapping The ActionMapping used to select this instance
   @param form The optional ActionForm bean for this request (if 
any)
   @param req The non-HTTP request we are processing
   @param res The non-HTTP response we are creating
   @return Return an ActionForward instance describing where and 
how
   control should be forwarded, or null if the response has
already
   been completed.
 */
 public ActionForward perform(ActionMapping mapping,
 ActionForm form,  HttpServletRequest req,
 HttpServletResponse res

RE: Newbie to struts

2002-09-17 Thread angela mcgrenra

Got it sorted - u were right Howard, had nothing to do with struts.jar.

I added the path to the classes directory to the javac command and it 
compiled ok...not the way to go though!

Thanks for all your help

Angie


From: Howard Miller [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Subject: RE: Newbie to struts
Date: Tue, 17 Sep 2002 11:28:21 +0100

Correct me if I'm wrong, but it seems that the compiler is not finding 
class
Book, which is (supposed to be) in the same default package as BookAction?
Therefore the problem has nothing to do with struts.jar.

A couple of observations...
Don't use default packages with servlets and suchlike. You get away with it
for a while but then weird things start happening - I found out the hard
way!!
Strongly recommend looking at Tomcat/ant source setup. This has the
advantage of loading your application on-the-fly without creating subdirs 
of
the tomcat distribution.
Are you using some sort of IDE for this (which might be screwing up the
classpath)?
Is BookActoin.java.. in your file list just a typing error, or is it really
called that? (That would do it!!)

HM

-Original Message-
From: angela mcgrenra [mailto:[EMAIL PROTECTED]]
Sent: 17 September 2002 11:11
To: [EMAIL PROTECTED]
Subject: RE: Newbie to struts


OKAY

I have a dir structure as follows

C:\java\jakarta-tomcat-3.3.1\webapps\strutsShop\BookView.jsp
C:\java\jakarta-tomcat-3.3.1\webapps\strutsShop\CreateBook.jsp
C:\java\jakarta-tomcat-3.3.1\webapps\strutsShop\WEB-INF\classes\Book.java
C:\java\jakarta-tomcat-3.3.1\webapps\strutsShop\WEB-INF\classes\BookActoin.j
ava

Code for BookView.jsp is:

%@ page language=java %
 %@ taglib uri=/WEB-INF/struts-bean.tld  prefix=bean %
 %@ taglib uri=/WEB-INF/struts-html.tld  prefix=html %
 %@ taglib uri=/WEB-INF/struts-logic.tld prefix=logic %

 html:html locale=true
 head
 html:base/
 title
 bean:message key=index.title/
 /title
 /head

 bodyAngela's test page/body
   html:form action=createBook method=GET
 Title:html:text property=title / br/
 html:submit property=submit/
 /html:form
 /html:html


Code for CreateBook.jsp is:

%@ page language=java %
%@ taglib uri=/WEB-INF/struts-bean.tld  prefix=bean %
%@ taglib uri=/WEB-INF/struts-html.tld  prefix=html %
%@ taglib uri=/WEB-INF/struts-logic.tld prefix=logic %

html:html locale=true
head
html:base/
titlebean:message key=index.title//title
/head
body bgcolor=white
h2Create a book/h2
html:errors/
html:form action=createBook.do method=GET
 Title:html:text property=title / br/
 html:submit property=submit/
/html:form
/body
/html:html

IN C:\java\jakarta-tomcat-3.3.1\webapps\strutsShop\WEB-INF\classes
I have Book.java (compiles into class file fine)
Code is :

import java.util.Vector;

public class Book
{

 private String title = ;
 private Vector authors = new Vector();
 private int pages = 0;

 /** Standard constructor. */
 public Book()
 { }

 /** @param title The new Title   */
 public void setTitle(String title)
 {  this.title = title;   }

 /** @return The title. */
 public String getTitle()
 { return this.title; }

 /** @param pages The new number of pages. */
 public void setPages(int pages)
 { this.pages = pages; }

 /** @return The number of pages. */
 public int getPages()
 { return this.pages; }

 /**
 We don't want to work with the Vector here, as it is
 only a reference we would get!
 @param author Add another author
 */
 public void addAuthor(String author)
 { this.authors.add(author); }


 /**
 Pay attention not to use the wrong number.
 @param position The number of the author to remove.
 */
 public void removeAuthor(int position)
 { this.authors.remove(position); }

 /** @return The number of authors the book has. */
 public int getNumberOfAuthors()
 { return this.authors.size(); }
}

Code for BookAction.java is:

import javax.servlet.http.*;
import org.apache.struts.action.*;


 /*
 The action for the creation of a book.
 @author [EMAIL PROTECTED]
 */
 public final class BookAction extends Action
 {

 /**
   @param mapping The ActionMapping used to select this instance
   @param form The optional ActionForm bean for this request (if 
any)
   @param req The non-HTTP request we are processing
   @param res The non-HTTP response we are creating
   @return Return an ActionForward instance describing where and 
how
   control should be forwarded, or null if the response has
already
   been completed.
 */
 public ActionForward perform(ActionMapping mapping,
 ActionForm form,  HttpServletRequest req,
 HttpServletResponse res

RE: Newbie to struts

2002-09-17 Thread angela mcgrenra

Got it sorted - u were right Howard, had nothing to do with struts.jar.

I added the path to the classes directory to the javac command and it 
compiled ok...not the way to go though!

Thanks for all your help

Angie


From: Howard Miller [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Subject: RE: Newbie to struts
Date: Tue, 17 Sep 2002 11:28:21 +0100

Correct me if I'm wrong, but it seems that the compiler is not finding 
class
Book, which is (supposed to be) in the same default package as BookAction?
Therefore the problem has nothing to do with struts.jar.

A couple of observations...
Don't use default packages with servlets and suchlike. You get away with it
for a while but then weird things start happening - I found out the hard
way!!
Strongly recommend looking at Tomcat/ant source setup. This has the
advantage of loading your application on-the-fly without creating subdirs 
of
the tomcat distribution.
Are you using some sort of IDE for this (which might be screwing up the
classpath)?
Is BookActoin.java.. in your file list just a typing error, or is it really
called that? (That would do it!!)

HM

-Original Message-
From: angela mcgrenra [mailto:[EMAIL PROTECTED]]
Sent: 17 September 2002 11:11
To: [EMAIL PROTECTED]
Subject: RE: Newbie to struts


OKAY

I have a dir structure as follows

C:\java\jakarta-tomcat-3.3.1\webapps\strutsShop\BookView.jsp
C:\java\jakarta-tomcat-3.3.1\webapps\strutsShop\CreateBook.jsp
C:\java\jakarta-tomcat-3.3.1\webapps\strutsShop\WEB-INF\classes\Book.java
C:\java\jakarta-tomcat-3.3.1\webapps\strutsShop\WEB-INF\classes\BookActoin.j
ava

Code for BookView.jsp is:

%@ page language=java %
 %@ taglib uri=/WEB-INF/struts-bean.tld  prefix=bean %
 %@ taglib uri=/WEB-INF/struts-html.tld  prefix=html %
 %@ taglib uri=/WEB-INF/struts-logic.tld prefix=logic %

 html:html locale=true
 head
 html:base/
 title
 bean:message key=index.title/
 /title
 /head

 bodyAngela's test page/body
   html:form action=createBook method=GET
 Title:html:text property=title / br/
 html:submit property=submit/
 /html:form
 /html:html


Code for CreateBook.jsp is:

%@ page language=java %
%@ taglib uri=/WEB-INF/struts-bean.tld  prefix=bean %
%@ taglib uri=/WEB-INF/struts-html.tld  prefix=html %
%@ taglib uri=/WEB-INF/struts-logic.tld prefix=logic %

html:html locale=true
head
html:base/
titlebean:message key=index.title//title
/head
body bgcolor=white
h2Create a book/h2
html:errors/
html:form action=createBook.do method=GET
 Title:html:text property=title / br/
 html:submit property=submit/
/html:form
/body
/html:html

IN C:\java\jakarta-tomcat-3.3.1\webapps\strutsShop\WEB-INF\classes
I have Book.java (compiles into class file fine)
Code is :

import java.util.Vector;

public class Book
{

 private String title = ;
 private Vector authors = new Vector();
 private int pages = 0;

 /** Standard constructor. */
 public Book()
 { }

 /** @param title The new Title   */
 public void setTitle(String title)
 {  this.title = title;   }

 /** @return The title. */
 public String getTitle()
 { return this.title; }

 /** @param pages The new number of pages. */
 public void setPages(int pages)
 { this.pages = pages; }

 /** @return The number of pages. */
 public int getPages()
 { return this.pages; }

 /**
 We don't want to work with the Vector here, as it is
 only a reference we would get!
 @param author Add another author
 */
 public void addAuthor(String author)
 { this.authors.add(author); }


 /**
 Pay attention not to use the wrong number.
 @param position The number of the author to remove.
 */
 public void removeAuthor(int position)
 { this.authors.remove(position); }

 /** @return The number of authors the book has. */
 public int getNumberOfAuthors()
 { return this.authors.size(); }
}

Code for BookAction.java is:

import javax.servlet.http.*;
import org.apache.struts.action.*;


 /*
 The action for the creation of a book.
 @author [EMAIL PROTECTED]
 */
 public final class BookAction extends Action
 {

 /**
   @param mapping The ActionMapping used to select this instance
   @param form The optional ActionForm bean for this request (if 
any)
   @param req The non-HTTP request we are processing
   @param res The non-HTTP response we are creating
   @return Return an ActionForward instance describing where and 
how
   control should be forwarded, or null if the response has
already
   been completed.
 */
 public ActionForward perform(ActionMapping mapping,
 ActionForm form,  HttpServletRequest req,
 HttpServletResponse res

Re: newbie to struts - confirm hierachy( packages - webapps)!!

2001-06-05 Thread Jonathan Asbell



I decided to NOT use the Struts.jar, but instead 
use the Struts source files, and then add my own directories below the classes 
directory for that particular web app. That way I could tweak Struts and 
have a better way of replacing updates to the classes. My setup is like 
this:
1) Struts framework - /struts/org/apache/struts 
etc... with my classpath pointing to /struts
2) My framework - /vnu/com/vnu/ etc... with my 
classpath pointing to /vnu
3) My classes for the particular web app - 

WEB-INF/classes/com/mywebapp/actions
WEB-INF/classes/com/mywebapp/forms
WEB-INF/classes/com/mywebapp/globals
WEB-INF/classes/com/mywebapp/models
WEB-INF/classes/com/mywebapp/taglib
with the classpath pointing to WEB-INF/classes

  - Original Message - 
  From: 
  Chuck Amadi 
  To: Craig R. McClanahan ; Petr 
  Jiricka 
  Sent: Tuesday, June 05, 2001 5:31 
AM
  Subject: newbie to struts - confirm 
  hierachy( packages - webapps)!!
  Hi, i have constructed a web app within my file system as 
  follows:- 
  C:\jakarta-tomcat-3.2.1\webapps\struts-bbnpa\WEB-INF\classes\logon\LogonForm.java 
  The struts-bbnpa is were im placing all my work. thus the examples 
  custom and logon packages are beneath my classes directory. Thus is this the 
  correct procedure as im about to venture into JDBC Project (Postgresql) and im 
  not sure weather the packages are one level above \WEB-INF dir. 
  Any suggestions and confirmation extremely welcomed. Cheers inadvance. 
  Chuck (Graduate Systems Programmer) -- The views expressed by the 
  sender of this message don't necessarily represent those of Brecon Beacons 
  National Park Authority. This message is intended for the addressee(s) 
  only and is sent in confidence; if you receive it in error, please can you 
  let us know (at [EMAIL PROTECTED]) and then destroy all copies. 
  Nid yw'r farn a fynegir gan anfonwr y neges hon o anghenraid yn 
  adlewyrchu barn Awdurdod Parc Cenedlaethol Bannau Brycheiniog. Neges 
  yw hon a fwriadwyd ar gyfer y derbynnydd/derbynyddion yn unig ac fe'i 
  hanfonir yn gyfrinachol; os ydych yn ei dderbyn mewn camgymeriad, a 
  fyddech gystal â rhoi gwybod i ni (yn [EMAIL PROTECTED]) ac yna dilëwch 
  bob copi.  


Re: newbie to struts - confirm hierachy( packages - webapps)!!

2001-06-05 Thread Ted Husted

Some people like to keep the source Java files at a separate location,
and then have Ant copy them over to the classes directory, but mixing
the class and java files in the same folder works too.

Personally, when using a package hierarchy for my classes, I tend to
just name things 

.\logon\Form.java

But, yes you should either put your packages class files below the
classes directory, or in a JAR in the lib folder. For development at
least, you probably just want to put them under classes.

We put these under the WEB-INF folder so that they cannot be directly
accessed by a client program (e.g. Web browser), only by the
application.

Chuck Amadi wrote:
 
 Hi, i have constructed a web app within my file system as follows:-
 C:\jakarta-tomcat-3.2.1\webapps\struts-bbnpa\WEB-INF\classes\logon\LogonForm.java
 
  The struts-bbnpa is were im placing all my work. thus the examples
 custom and logon packages are beneath my classes directory. Thus is
 this the correct procedure as im about to venture into JDBC Project
 (Postgresql) and im not sure weather the packages are one level above
 \WEB-INF dir.
 
 Any suggestions and confirmation extremely welcomed. Cheers inadvance.
 
 Chuck (Graduate Systems Programmer)
 --



Re: newbie to struts - confirm hierachy( packages - webapps)!!

2001-06-05 Thread Jonathan Asbell

jeez.  You are up early!

- Original Message -
From: Ted Husted [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, June 05, 2001 6:30 AM
Subject: Re: newbie to struts - confirm hierachy( packages - webapps)!!


 Some people like to keep the source Java files at a separate location,
 and then have Ant copy them over to the classes directory, but mixing
 the class and java files in the same folder works too.

 Personally, when using a package hierarchy for my classes, I tend to
 just name things

 .\logon\Form.java

 But, yes you should either put your packages class files below the
 classes directory, or in a JAR in the lib folder. For development at
 least, you probably just want to put them under classes.

 We put these under the WEB-INF folder so that they cannot be directly
 accessed by a client program (e.g. Web browser), only by the
 application.

 Chuck Amadi wrote:
 
  Hi, i have constructed a web app within my file system as follows:-
 
C:\jakarta-tomcat-3.2.1\webapps\struts-bbnpa\WEB-INF\classes\logon\LogonForm
.java
 
   The struts-bbnpa is were im placing all my work. thus the examples
  custom and logon packages are beneath my classes directory. Thus is
  this the correct procedure as im about to venture into JDBC Project
  (Postgresql) and im not sure weather the packages are one level above
  \WEB-INF dir.
 
  Any suggestions and confirmation extremely welcomed. Cheers inadvance.
 
  Chuck (Graduate Systems Programmer)
  --





Re: Newbie to struts - jdbc/dbtags

2001-06-05 Thread kuma.cra

Hi Ted , it did thanks.

Ted Husted wrote:
 
 You can configure Postgresql in the struts-config.xml, and then use the
 same datasource with the Jakarta Taglibs JDBC. Works like a charm.
 
 Struts uses org.apache.struts.action.DATA_SOURCE as the datasource
 identifier (see Action.java).
 
 kuma.cra wrote:
 
  Hi,  im a newbie to struts basically applying the examples and reading
  the documentation (mvc). I am about to connect a psql datasource
  (Postgresql, luinx OS) database to a struts mvc utilizing a database URL
  .
 
  Thus is there a ActionForm example and what level if i have to create a
  ActionForm class i.e /WEB-INF/classes/custom/ActionForm or can i create
  a package above WEB-INF as at the moment i am creating/modifying
  examples from the taglib's and packaging them under mt Struts-bbnpa (my
  re-named struts app's.
 
 -- Ted Husted, Husted dot Com, Fairport NY USA.
 -- Custom Software ~ Technical Services.
 -- Tel 716 737-3463.
 -- http://www.husted.com/about/struts/



Re: Newbie to struts - jdbc/dbtags

2001-06-04 Thread kuma.cra



Hi,  im a newbie to struts basically applying the examples and reading
the documentation (mvc). I am about to connect a psql datasource
(Postgresql, luinx OS) database to a struts mvc utilizing a database URL
.

Thus is there a ActionForm example and what level if i have to create a
ActionForm class i.e /WEB-INF/classes/custom/ActionForm or can i create
a package above WEB-INF as at the moment i am creating/modifying
examples from the taglib's and packaging them under mt Struts-bbnpa (my
re-named struts app's.



Re: Newbie to struts - jdbc/dbtags

2001-06-04 Thread Ted Husted

You can configure Postgresql in the struts-config.xml, and then use the
same datasource with the Jakarta Taglibs JDBC. Works like a charm. 

Struts uses org.apache.struts.action.DATA_SOURCE as the datasource
identifier (see Action.java).

kuma.cra wrote:
 
 Hi,  im a newbie to struts basically applying the examples and reading
 the documentation (mvc). I am about to connect a psql datasource
 (Postgresql, luinx OS) database to a struts mvc utilizing a database URL
 .
 
 Thus is there a ActionForm example and what level if i have to create a
 ActionForm class i.e /WEB-INF/classes/custom/ActionForm or can i create
 a package above WEB-INF as at the moment i am creating/modifying
 examples from the taglib's and packaging them under mt Struts-bbnpa (my
 re-named struts app's.

-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 737-3463.
-- http://www.husted.com/about/struts/



Re: Newbie to Struts

2001-02-26 Thread Martin Cooper

Standard JSP tags behave the same way in a Struts application as they do in
any other web application. You might want to check a general JSP resource,
such as the JSP-INTEREST archives at:

http://archives.java.sun.com/archives/jsp-interest.html

Hope this helps.

--
Martin Cooper
Tumbleweed Communications


- Original Message -
From: "JeanX" [EMAIL PROTECTED]
To: "struts-user" [EMAIL PROTECTED]
Sent: Monday, February 26, 2001 10:13 PM
Subject: Newbie to Struts


 Hi struts-user,

 Can anybody tell me how to use jsp:include  tag in a application under
struts framework.
 I was puzzled this problem for a dog's age.
 Thx a lot.

 :=)
 Best regards,
 JeanX
 pacificnet.com(GZ)