RE: Help please - indexed field in ActionForm

2003-08-14 Thread Gary Kephart
Haven't used JSTL yet, but let me try this...

 class MyActionForm
 {
   private static final MAX_ENTRIES = 50;
   private ArrayList text;
 
   public MyActionForm()
   {
 text = new ArrayList(MAX_ENTRIES);
  for (int x = 0; x  MAX_ENTRIES; x++)
  {
text.add(); // avoids IndexOutOfBoundsException later in setText
  }
   }
 
   // used by MyAction
   public ArrayList getText() {return text;}
 
   //  Used by Struts
  public void setText(int index, String newText) {text.set(index, newText);}
}
 
 my.jsp
 html:html
   body
 html:form action=MyAction.do
   logic:iterate id=text indexId=index name=myForm property=text
 !-- Note trickery here. Not using html:text --
 Label:input type=text name='text[bean:write name=indexId/]'/br/
   /logic:iterate
   html:submit/
 /html:form
   body
 /html:html

Gary Kephart| New Century Mortgage
Web-Based Application Developer | http://www.ncen.com
[EMAIL PROTECTED]   | 340 Commerce
949-797-5660| Irvine, CA  92602-1318


 -Original Message-
 From: David Thielen [mailto:[EMAIL PROTECTED]
 Sent: Thursday, August 07, 2003 4:39 PM
 To: Struts Users Mailing List
 Subject: Re: Help please - indexed field in ActionForm
 
 
 Hi;
 
 Thank you - this is part of what I need.
 
 Is there any way to iterate through the lines if I don't know 
 up front how
 many lines there will be? I tried the with the c JSTL and it 
 doesn't work.

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



RE: Help please - indexed field in ActionForm

2003-08-14 Thread Gary Kephart
class MyActionForm
{
  private static final MAX_ENTRIES = 50;
  private String[] text;

  public MyActionForm()
  {
text = new String[MAX_ENTRIES];
  }

  public String[] getText() {return text;}

  public void setText(int index, String newText) {text[index] = newText;}
}

my.jsp
html:html
  body
html:form action=MyAction.do
  Label 1:html:text property=text[0]/br/
  Label 2:html:text property=text[1]/br/
  html:submit/
/html:form
  body
/html:html


Gary Kephart| New Century Mortgage
Web-Based Application Developer | http://www.ncen.com
[EMAIL PROTECTED]   | 340 Commerce
949-797-5660| Irvine, CA  92602-1318


 -Original Message-
 From: David Thielen [mailto:[EMAIL PROTECTED]
 Sent: Thursday, August 07, 2003 3:46 PM
 To: Struts-Users
 Subject: Help please - indexed field in ActionForm
 
 
 Hi;
 
 I've been fighting this all day with no luck. And it has to 
 be a simple thing to do.
 
 I have a form where I have N lines in it. Each line needs to 
 have some text displayed and an edit box.
 
 How do I set this up in the .jsp file and in the ActionForm? 
 I've found a number of examples on the web but they all have 
 incomplete code and my guesses for the rest of the code have 
 not been right so far.
 
 thanks - dave
 

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



RE: Internationalizing 100's of pages of text

2003-08-14 Thread Gary Kephart

 -Original Message-
 From: Adam Levine [mailto:[EMAIL PROTECTED]
 Sent: Thursday, August 07, 2003 9:44 AM
 To: [EMAIL PROTECTED]
 Subject: Re: Internationalizing 100's of pages of text
 
 
 My $0.02, just a bit OT, and an observation...if you change your 
 organization a bit, you can make life easier and you (and 
 whomever else is 
 working on your content) by using Java's i18n features in a 
 bit different 
 manner.. specifically, get a String-based version of the 
 Locale you want.. 
 make that a directory, and just load the same template file 
 from there.
 
 ie
   content/en_us/index_content.jsp
   content/en/index_content.jsp
 
 since you'll always know which file (index_content) you 
 want.. i'm sure you 
 can hack a tag that will dynamically create the full file 
 name you want, and 
 have that passed to template:get (which i've never worked 
 with.. so, forgive 
 me if i'm way off base).

Hmm. A possibility.

 I tried hitting the url you gave.. it doesn't appear to be a 
 happy url, so i 
 can't see exactly what kind of content you're working with.   
 Is putting the 
 text into a database a possibility, keyed by content_id and 
 language/locale_id ?

Try this:
http://www.photeus.com:8080/ewot/index.html
I've had to monkey around with things on my system since my ISP (Cox cable) blocks 
port 80. I've set up a redirect to port 8090, which may be blocked to you. I would use 
8080, but Tomcat's on that and I've only got a Pentium Pro 200 on that machine and 
Apache's web server takes less hp than Tomcat.

As far as database, take a look at the content now and see what you think. The big 
stumbling block is that the content writers are remote, and so I'd have to set up some 
sort of remote database access and my content writers don't have much, if any, db 
experience.

Gary

Gary Kephart| New Century Mortgage
Web-Based Application Developer | http://www.ncen.com
[EMAIL PROTECTED]   | 340 Commerce
949-797-5660| Irvine, CA  92602-1318

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



RE: Internationalizing 100's of pages of text

2003-08-10 Thread Gary Kephart


 Is there a reason you don't want to put the content into a database?

The content writers are remote, so I would have to create web access to a database. 
Too much work. Plus, I don't think that the content lends itself to databases.

Gary

Gary Kephart| New Century Mortgage
Web-Based Application Developer | http://www.ncen.com
[EMAIL PROTECTED]   | 340 Commerce
949-797-5660| Irvine, CA  92602-1318

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



Internationalizing 100's of pages of text

2003-08-07 Thread Gary Kephart
I have a web site at http://www.pobox.com/~encyclopaedia_wot. It contains 100's of 
pages of HTML of mostly text. I'd like to migrate this to JSPs and use Templates/Tiles 
because:
1) I want to better standardize the layout
2) I want the content writer to not have to worry about anything but content (by 
having them write only the xx_content.jsp files)
 
I also want to internationalize it. I've already had requests for Spanish and Hebrew 
versions. However, putting the text into one or more property files seems like a 
Really Bad Idea. So is having hundreds of definition files. What I'd like to do is 
have something like this:
1) a template that has a 'content' parameter
2) an index.jsp which uses the template and specifies 'index_content.jsp' as 'content'
3) have template:get search for 'index_content_en_us.jsp', then 'index_content_en.jsp' 
then 'index_content.jsp'.
 
Aside from writing my own version of template:get (which I can), is there a better, 
existing way of doing this?
 
TIA,
  Gary
Gary Kephart| New Century Mortgage

Web-Based Application Developer | http://www.ncen.com

[EMAIL PROTECTED]   | 340 Commerce

949-797-5660| Irvine, CA  92602-1318
 


FAQ additions? (was Re: Help: Cannot find bean BEAN in scope null)

2001-08-30 Thread Gary Kephart

Thomas Quas wrote:

 Gary,

 it usually happens to me when I close the html:form too early, meaning
 there are some html:text's or others floating around after I did
 /html:form.

That was it. After that I had another problem, which a co-worker solved. At
any rate, here's two things to put into the FAQ:

Q: I get this message in my log file: Cannot find bean
org.apache.struts.taglib.html.BEAN in scope null. What's causing it?
A: it usually happens to me when I close the html:form too early, meaning
there are some html:text's or others floating around after I did
/html:form. (Thomas Quas [EMAIL PROTECTED])

Q: I get this message in my log file: No getter method for property
myProperty of bean org.apache.struts.taglib.html.BEAN even though I have a
getter method in my form bean.
A: This is a matter of case-sensitivity. Even though your Java method will be
public string getMyProperty(), with the M capitalized, the first letter of
the property in the JSP will be lower case. Your JSP will have this in it:
html:text property=myProperty  /


 Gary Kephart wrote:
 
  I get this message in the log file:
 
  Cannot find bean org.apache.struts.taglib.html.BEAN in scope null

Gary
--
Gary Kephart   | Basis 100
Software Engineer  | 4 Park Plaza, Suite 800
[EMAIL PROTECTED]  | Irvine, CA 92614
(949) 852-8600x262 | http://www.basis100.com

This communication is intended only for the use of the individual or
entity to whom/which it is addressed, and information contained in this
communication is privileged and confidential.  If the receiver of this
message is not the intended recipient, you are hereby notified that any
dissemination, distribution or copying of this communication is strictly
prohibited.  If you have received this communication in error, please
notify us at the above telephone number (so that we may correct our
internal records) and delete this communication without making a copy of
it.  Thank you.




Help: Cannot find bean BEAN in scope null

2001-08-29 Thread Gary Kephart

I get this message in the log file:

Cannot find bean org.apache.struts.taglib.html.BEAN in scope null

Does anyone know why this happened and how to fix it?

Thanks,
  Gary
--
Gary Kephart   | Basis 100
Software Engineer  | 4 Park Plaza, Suite 800
[EMAIL PROTECTED]  | Irvine, CA 92614
(949) 852-8600x262 | http://www.basis100.com

This communication is intended only for the use of the individual or
entity to whom/which it is addressed, and information contained in this
communication is privileged and confidential.  If the receiver of this
message is not the intended recipient, you are hereby notified that any
dissemination, distribution or copying of this communication is strictly

prohibited.  If you have received this communication in error, please
notify us at the above telephone number (so that we may correct our
internal records) and delete this communication without making a copy of

it.  Thank you.




FAQ?

2001-08-28 Thread Gary Kephart

I've just downloaded, installed and tried to run Struts this week. Of
course, as a newbie, I hit some snags. Got past most of them, but then
went looking for a FAQ list for Struts, but to no avail. Is there one?
If so, where?

BTW, the problem I'm trying to solve is this message in the log file:

javax.servlet.jsp.JspException: Cannot find ActionMappings or
ActionFormBeans collection

I can't tell if I'm missing a jar file or some xml file needs to be
modified.

Thanks,
  Gary
--
Gary Kephart   | Basis 100
Software Engineer  | 4 Park Plaza, Suite 800
[EMAIL PROTECTED]  | Irvine, CA 92614
(949) 852-8600x262 | http://www.basis100.com

This communication is intended only for the use of the individual or
entity to whom/which it is addressed, and information contained in this
communication is privileged and confidential.  If the receiver of this
message is not the intended recipient, you are hereby notified that any
dissemination, distribution or copying of this communication is strictly

prohibited.  If you have received this communication in error, please
notify us at the above telephone number (so that we may correct our
internal records) and delete this communication without making a copy of

it.  Thank you.




Re: FAQ?

2001-08-28 Thread Gary Kephart

Gary Kephart wrote:

 I've just downloaded, installed and tried to run Struts this week. Of
 course, as a newbie, I hit some snags. Got past most of them, but then
 went looking for a FAQ list for Struts, but to no avail. Is there one?
 If so, where?

 BTW, the problem I'm trying to solve is this message in the log file:

 javax.servlet.jsp.JspException: Cannot find ActionMappings or
 ActionFormBeans collection

 I can't tell if I'm missing a jar file or some xml file needs to be
 modified.

Found the answer to my problem in my web.xml file. Used the damned example
file and didn't change the values. Onto the next problem...

But I would still like to know if there's a FAQ around somewhere.

Thanks,
  Gary
--
Gary Kephart   | Basis 100
Software Engineer  | 4 Park Plaza, Suite 800
[EMAIL PROTECTED]  | Irvine, CA 92614
(949) 852-8600x262 | http://www.basis100.com

This communication is intended only for the use of the individual or
entity to whom/which it is addressed, and information contained in this
communication is privileged and confidential.  If the receiver of this
message is not the intended recipient, you are hereby notified that any
dissemination, distribution or copying of this communication is strictly
prohibited.  If you have received this communication in error, please
notify us at the above telephone number (so that we may correct our
internal records) and delete this communication without making a copy of
it.  Thank you.