>What do you want the Enter key to do? Do you want it to move to the next
>control, i.e., act like the Tab key?
That would be ideal - provided it continued to work as an Enter key within
textarea's.
-
To unsubscribe, e-mai
>What do you want the Enter key to do? Do you want it to move to the next
>control, i.e., act like the Tab key?
That would be ideal.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTEC
Anyone know how to stop a struts form from being submitted when the Enter
key is pressed and focus isn't on the submit button?
(ie I still want Enter to work - I just don't want Enter to equate to
pressing submit).
-
To unsu
I should add that my previous post provides a mechanism for displaying your
check-boxes and capturing the user's responses.
You'll still need some code in your Action that processes the form to
recover the selected responses, something like this:
String[] sc = questionform.getSelectedCl
I'll assume you have an iteration in your JSP that goes like this:
...
where "clients" corresponds to your collection of client beans. (ie you
have a method in your form called 'getClients()' that returns a List.)
The id "client" is the name I've made up for the bean that comes into sc
I'm working on an application API to be deployed with struts, and am
interested in how other developers are dealing with 'editing' methods, ie
methods that answer a question with a true/false value, but if false is
returned, you also want to know why.
for example, a credit card application ma
>Are you sure? Isn't it m-d-y?
Yes. Here's the code (getOrderDate returns a java.util.Date) :
If row.orderDate is 01-01-0001, blanks are displayed. If row.orderDate is
16-09-2004, '2004-09-16' is displayed.
(we do d/m/y in New Zealand).
>> Since the posting I made a happy discovery thoug
Treating them to a nice dinner and a romantic movie usually works ;-)
HawHaw - I guess it depends on HOW optional!
>Any reason you cant model them as null?
The date's already defined as 'not null' on the data-base and I wanted to
avoid touching it. Wouldn't null dates appear as 'null' if
Hi all,
I'm curious as to the best way to treat dates in a struts form when entry
of the date is optional.
Currently I'm storing un-entered optional dates as 1/1/1970.
When I come to display an optional date field on a form, I need to decide
whether to display a formatted date or a blank (by
I was using v2.1.3, and not referring to any external version of Ant.
If you've used previous versions of Eclipse then you're already way more
familiar with it than I am, and unlikely to do some of the mad things I
did.
All the same, I thought it shouldn't generate bad class files - either
go
I struck this problem with Eclipse and ant a couple a months ago.
It looked as if the java compiler was generating incomplete class files.
I can't advise of any known problem or fix to it though - I was only
evaluating Eclipse at the time and switched to another tool.
Regards,
John
[EMAIL PR
Brian,
Not exactly what you're after, but close.
The following code creates a directory called 'home' in the root directory
of a context.
(Class 'File' can be used for manipulating directories as well as files)
// create home directory if none
String
homedirName=serv
There are probably better ways, but I've used the following java code for
that purpose.
public static String getFullURL(HttpServletRequest request) {
if (request==null) return null;
StringBuffer url = new StringBuffer();
url.append( (request.isSecure() ? "https://"; : "http://";
>say for example I have a list with 10 objects. I am displaying a list on a
page with a check box. the object has a boolean property. depending
on the value of the property the check box should be checked or
unchecked initially.( In case of Multibox all of them are unchecke
To use a multibox, you need a getter and setter method in your form-bean
that returns/sets a String array.
Each element in this String array corresponds to the value of a checked
check-box.
Let's say you have a multibox coded like this:
ie
1) myFormBean has a method 'getDataBaseR
You could add your own attribute to a form tag, so that your javascript
could distinguish forms based on the value/presence of this attribute.
eg the following has 5 different forms, all with the same name and fields,
but I've added a new attribute 'mylabel':
function showForms() {
var
Try this:
Regards,
John
[EMAIL PROTECTED]
Ph (09) 372-5010
|-+>
| | Leandro Melo |
| | <[EMAIL PROTECTED]|
| | oo.com.br> |
| ||
| |
You don't need a form with an action.
I have an action called 'HomeAction' - it's job is to decide where to
direct a user based on their allowable actions.
It's configured like this in struts-config:
ie 'HomeAction' gets called using the url path '/home'. HomeAction
Please ignore the previous post, I left out an iterate.
I have the following struts labels on a jsp:
And it's generating the following html:
... and so on for as many items in the surveySittingForm.
What I really want is this:
Can I do this with t
Hi All,
I have the following struts labels on a jsp:
And it's generating the following html:
... and so on for as many items in the surveySittingForm.
What I really want is this:
Can I do this with the multi-box tag?
---
I've just shown these rich-text editors to our users and they are ecstatic.
Thanks to everybody who responded - amazing where a simple question will
lead.
Regards,
John
[EMAIL PROTECTED]
Ph (09) 372-5010
|-+>
| | "Simone - Dev" |
|
Looks like I went a bit over the top with the embedded html proposal.
It seems the users would be content if whatever they'd keyed into a
text-area looked the same when
subsequently re-displayed as text in a document.
ie just preserve the line-feeds, no need for bolding etc.
Any ideas?
The usual suspects are:
1) not granting public access to the file you're trying to download.
2) your http server not allowing access to the directory or file type
specified.
Just in case the obvious isn't so obvious today.
Regards,
John
[EMAIL PROTECTED]
Ph (09) 372-5010
|-+--
Hi All,
I have a struts app that lets users input into text-areas. Whatever the
user entered will later be displayed as text.
To give users some control over presentation, I'd like to allow them to
enter html directly into a text-area.
Struts appears to convert all html to harmless displayabl
Please excuse the question - turns out I'm using Struts 1.1
Regards,
John
[EMAIL PROTECTED]
Ph (09) 372-5010
|-+>
| | [EMAIL PROTECTED]|
| | o.nz |
| ||
| |
I'm trying to use the saveErrors method in an Action class using
(request,actionMessages) as parameters, instead of (request,actionErrors)
which has been deprecated.
I keep getting the following error at compilation though:
saveErrors(javax.servlet.http.HttpServletRequest,org.apache.struts.ac
Good point.
I've done the same, ie setup a within the of
server.xml, and defined my data-source there.
I've still got a context.xml, but it's now down to just a couple of lines
ie to specify docBase, path and a logger.
It looks like this now:
Just to make it clear what this is all abou
If you're auto-deploying and can get the DefaultContext to work for you,
then that's what I'd do. (I'm not auto-deploying, so my case isn't so
straight-forward).
You always have the fall-back of configuring Context datasources if you run
into trouble.
There's an example of configuring a Defau
I recall reading about a month ago that setting up of data-sources in
struts-config was purely for some backwards-compatability issue, and was no
longer advised.
I haven't bothered to do it.
I set up my data source in a server.xml context, and it works fine.
Like you I'd prefer to have server
http://struts.apache.org/api/org/apache/struts/util/LabelValueBean.html
Regards,
John
[EMAIL PROTECTED]
Ph (09) 372-5010
|-+>
| | Michael McGrady |
| | <[EMAIL PROTECTED]|
| | ady.com> |
|
Are you using Tomcat in-process with the apache server on an AS/400?
Your problem, and the fact you don't have .war deployment sound familar.
John Thompson
[EMAIL PROTECTED]
|-+>
| | Phyl |
| | <[EMAIL P
Thanks so much Bill, that worked beautifully.
Regards,
John
|-+>
| | Bill Siggelkow |
| | <[EMAIL PROTECTED]|
| | th.net> |
| | Sent by: news|
| | <[
I have a form bean with a string array defined as a property, with a
corresponding set/get like this:
private String[] answers = { "Answer 1","Answer 2","Answer 3","Answer
4","Answer 5" };
public String[] getAnswers() { return (this.answers); }
public void setAnswers(String[] value) { this.an
Speaking of newbie tips, I've been banging my head with struts/JSTL for the
past two weeks and discovered this gem today.
<% if (image.trim().length()>0) { %>
...
This lets me grab an object out of a form bean and switch to JSP script
mode so that I can use the full force of Java rather t
Thanks Erez, great answer.
Regards,
John
[EMAIL PROTECTED]
Ph (09) 372-5010
|-+>
| | Erez Efrati |
| | <[EMAIL PROTECTED]|
| | et.il> |
| ||
|
I'd like to be able to code the following line:
where Constants.HOME_DIR_KEY is a java method that returns the name of bean
"home_directory".
The following two lines work:
<%= Constants.HOME_DIR_KEY %>// returns the value
"home_directory"
I suppose it doesn't wor
I'd like to create directories programmatically (using a struts Action
class) in a tomcat webapp directory.
ie, with a url of http://domain.com:8080/testapp/... that maps to directory
/testing/webapps/testapp/...
how do I recover the '/testing/webapps/testapp' part in an Action class?
John
You could use:
Click Me
Threads:
Thanks for all the supports and help that I have
received so far on this topic.
I have another question about the converstion of Java
code:
Click Me
<%else {%>
Threads:
<%}%>
1. what is the JSTL equivalent of the <
Superb answer Bill.
I've coded the following which correctly gets the OptionsCollection, but
I'm stumped as to what to substitute in place of 'MyForm.key':
Type:
There are a couple of ways o
I've loaded a collection of valid options and their descriptions as a
ServletContext attribute, for use in an tag.
It works as intended in a generated html tag.
Once a user selects an option, the option value (rather than the
description) is recorded in a form bean, and the form bean is for
40 matches
Mail list logo