Author Login
Post Reply
user Digest 11 Jan 2010 19:55:19 -0000 Issue 8979
Topics (messages 204596 through 204605):
Re: Struts, Tomcat, JNDI, JDBC without use of an ORM Library such as Hibernate
204596 by: Jasvinder S. Bahra
drop down list auto suggest feature using Struts1.1/JSP/Javascript
204597 by: sri2003
204599 by: Paul Benedict
204602 by: Struts Two
Re: Struts 2 token and FilterDispatcher
204598 by: eduramiba
checked default
204600 by: Nguyen Xuan Son
Re: struts 1.3.8 trying to get the rendered output of a struts page from a plain servlet
204601 by: Paul Benedict
[S2] Can't get type conversion running with <s:select>-tags
204603 by: Michael Obster
Define Global Timeout [S2]
204604 by: Jorge Sousa
204605 by: Brian Thompson
Administrivia:
---------------------------------------------------------------------
To post to the list, e-mail: user@(protected)
To unsubscribe, e-mail: user-digest-unsubscribe@(protected)
For additional commands, e-mail: user-digest-help@(protected)
----------------------------------------------------------------------

Attachment:
user_204596.ezm (zipped)> Jazz, here's a lightweight package that so far has met all of my needs:
> http://butterfly.jenkov.com/ ...
I'll be sure to take a look.
Thanks for the response.
Jazz

Attachment:
user_204597.ezm (zipped)
Hi,
Need to have a drop down list with populated values; but when the user wants
to select a value, he can either type in the first few letters or select it
from the drop down list with the mouse or both.
example: a drop down list has 10 values. the user
clicks on the drop down and it allows him to type in the box or select the
value from the drop down, but if he type "A" it will just to all the values
starting with "A" and if he continues to type "Al" it will further goto all
the values that start with "Al" e.g. "Alex" and "Albert".
How do i go about doing this using Struts1.1/JSP/Javascript?
Any sample code/example would be great.
Thanks in advance
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_204599.ezm (zipped)Look into Java Web Parts. It's an ajax framework that's compatible
with Struts 1.
On Sun, Jan 10, 2010 at 8:21 AM, sri2003 <hipalani@(protected):
>
> Hi,
>
> Need to have a drop down list with populated values; but when the user wants
> to select a value, he can either type in the first few letters or select it
> from the drop down list with the mouse or both.
>
> example: a drop down list has 10 values. the user
> clicks on the drop down and it allows him to type in the box or select the
> value from the drop down, but if he type "A" it will just to all the values
> starting with "A" and if he continues to type "Al" it will further goto all
> the values that start with "Al" e.g. "Alex" and "Albert".
>
> How do i go about doing this using Struts1.1/JSP/Javascript?
>
> Any sample code/example would be great.
>
> Thanks in advance
> --
> View this message in context: http://old.nabble.com/drop-down-list-auto-suggest-feature-using-Struts1.1-JSP-Javascript-tp27098731p27098731.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_204602.ezm (zipped)You can also use Dojo with Struts 1. I am currently using dojo 1.3.2 with struts 1.3.10 with no issues whatsoever.
--- On Mon, 1/11/10, Paul Benedict <pbenedict@(protected):
> From: Paul Benedict <pbenedict@(protected)>
> Subject: Re: drop down list auto suggest feature using Struts1.1/JSP/Javascript
> To: "Struts Users Mailing List" <user@(protected)>
> Received: Monday, January 11, 2010, 2:35 AM
> Look into Java Web Parts. It's an
> ajax framework that's compatible
> with Struts 1.
>
> On Sun, Jan 10, 2010 at 8:21 AM, sri2003 <hipalani@(protected)>
> wrote:
> >
> > Hi,
> >
> > Need to have a drop down list with populated values;
> but when the user wants
> > to select a value, he can either type in the first few
> letters or select it
> > from the drop down list with the mouse or both.
> >
> > example: a drop down list has 10 values. the user
> > clicks on the drop down and it allows him to type in
> the box or select the
> > value from the drop down, but if he type "A" it will
> just to all the values
> > starting with "A" and if he continues to type "Al" it
> will further goto all
> > the values that start with "Al" e.g. "Alex" and
> "Albert".
> >
> > How do i go about doing this using
> Struts1.1/JSP/Javascript?
> >
> > Any sample code/example would be great.
> >
> > Thanks in advance
> > --
> > View this message in context: http://old.nabble.com/drop-down-list-auto-suggest-feature-using-Struts1.1-JSP-Javascript-tp27098731p27098731.html
> > Sent from the Struts - User mailing list archive at
> Nabble.com.
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > For additional commands, e-mail: user-help@(protected)
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
__________________________________________________________________
Connect with friends from any web browser - no download required. Try the new Yahoo! Canada Messenger for the Web BETA at http://ca.messenger.yahoo.com/webmessengerpromo.php

Attachment:
user_204598.ezm (zipped)I changed the filter FilterDispatcher for
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilterand it works perfect.
eduramiba wrote:
>
> Hi, I have a problem I don't know how to approach.
>
> For some actions, I use a token and it works perfect.
>
> But now I would like to use http://tuckey.org/urlrewrite/ Url Rewrite
> Filter which needs to include
>
> <dispatcher>FORWARD</dispatcher>
>
> in the struts 2 FilterDispatcher to work. When I do this, the JSPs with
> <s:token /> stop working because of a NullPointerException in
> TokenHelper.setToken()
>
> If I don't include <dispatcher>FORWARD</dispatcher> , the Url Rewrite
> rules only work if I set them to redirect, not forward (default). Of
> course this redirects to dirty url in the browser so it is not enough.
>
--
Sent from the Struts - User mailing list archive at Nabble.com.

Attachment:
user_204600.ezm (zipped)dear all
in the jsp file I have
<s:radio list="#{'Y':'はい','N':'いええ'}" name="saleoff.is_top"
value="%{saleoff.is_top}" />
I want the value 'N' is checked by default but dont know how to solve it
do you have any suggestion?
thank you very much
--
=======================================================================
Ritsumeikan University, Asia JinZai Project
Master of Information Science
Nguyen Xuan Son
Add : Japan, Shiga-Ken, Kusatsu-Shi, Kasayama 3choume 1-18 ShiteiHaimu
Rien, Room 103
Tel/Fax : 81-(0)90-3976 2246
Email : nr0003xx@(protected)
Mobile : 81-(0)90-3976 2246 URL : http://www.ritsumei.jp
=======================================================================

Attachment:
user_204601.ezm (zipped)Jason, I have only done this using JSTL tags. There is a <c:include>
(I believe) for this purpose.
On Mon, Jan 4, 2010 at 4:17 PM, Jason Novotny <jason.novotny@(protected):
> Hi,
>
> I have a plain vanilla servlet and I want to "include" via the
> RequestDispatcher mechanism the rendered output of a struts page. Here's the
> code I have:
>
> ServletContext ctx = servletConfig.getServletContext();
> RequestDispatcher rd =
> ctx.getRequestDispatcher("/modules/foo/Home.do?myparam=value");
> if (rd != null) {
>
> StringWriter stringWriter = new StringWriter();
> MyResponse myresponse = new MyResponse(response, stringWriter);
> rd.include(request, myresponse);
> System.err.println(stringWriter.toString());
>
> }
>
> I created MyResponse as a wrapper on ServletResponse that contains a buffer
> so I can pull out the contents. However, I'm not getting anything....
>
> Has anyone done this before? Or is there some easy way to do this?
>
> Thanks, Jason
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_204603.ezm (zipped)Hi,
I've a problem get the type conversion running in connection with a s:select.
I have an action (OrderABCEditAction.java) with a
"List<User> userlist;"
variable and corresponding getter and setter. Then I do a
<s:select id="leftSignature" name="order.orderABC.leftSignature"
list="userlist" listKey="id" listValue="%{displayName}" headerKey="-1"
headerValue=""/>
in the order_abc.jsp.
Then I have created a OrderABCEditAction-conversion.properties in the same
directory where my OrderABCEditAction.java is located with the following
content:
order.orderABC.leftSignature=de.eposcat.apbb.ui.converters.UserTypeConverter
The select field is populated with the values of the list. But when I try
to save I get a NoSuchMethodException setLeftSignature(String value),
which is correct, because only a method setLeftSignature(User value) is
existing.
After adding a System.out.println I have seen, that my converter does not
run. So I tried to implement an attribute leftsignature directly into my
OrderABCEditAction and changed the properties file and jsp to :
leftSignature=de.eposcat.apbb.ui.converters.UserTypeConverter
and
<s:select id="leftSignature" name="leftSignature" list="userlist"
listKey="id" listValue="%{displayName}" headerKey="-1" headerValue=""/>
This works, but why is the converter ignored if i use a nested property?
Regards,
Michael

Attachment:
user_204604.ezm (zipped)Hi,
First of all sorry for my bad english :)
I need to implement a feature in my application, that will enable me to
define the timeout of every request.
I tried to create a Interceptor and put the main thread on wait, while
other 2 threads, one will handle the time, and the other will make the
invocation.invoke(). The first of this two threads to complete, will
call the notify of the main thread and the correspondent result is returned.
I tried this approach, but i get a null pointer exception in the thread
that tried to execute the invocation.invoke().
Is there any suggestions?
If some one need more explanations, please let me know.
You can find the code bellow.
Thanks in advance,
Jorge Sousa from Portugal
Code:
public class TimeoutInterceptor extends AbstractInterceptor {
private static final ExecutorService threadPool =
Executors.newCachedThreadPool();
@Override
public String intercept(ActionInvocation invocation) throws Exception {
Invocator invocator = new Invocator(invocation, this);
TimeoutWatcher timeoutWatcher = new TimeoutWatcher(this);
threadPool.execute(invocator);
threadPool.execute(timeoutWatcher);
this.wait();
if (invocator.getResult().equalsIgnoreCase("running")) {
throw new TimeOutException();
} else {
return invocator.getResult();
}
}
private class TimeoutWatcher implements Runnable {
private AbstractInterceptor abstractInterceptor;
public TimeoutWatcher(AbstractInterceptor abstractInterceptor) {
this.abstractInterceptor = abstractInterceptor;
}
@Override
public void run() {
try {
Thread.sleep(10000);
} catch (InterruptedException e) {
}
synchronized (abstractInterceptor) {
abstractInterceptor.notify();
}
}
}
private class Invocator implements Runnable {
private ActionInvocation invocation;
private String result = "running";
private AbstractInterceptor abstractInterceptor;
public Invocator(ActionInvocation invocation,
AbstractInterceptor abstractInterceptor) {
this.invocation = invocation;
this.abstractInterceptor = abstractInterceptor;
}
@Override
public void run() {
try {
result = invocation.invoke();
synchronized (abstractInterceptor) {
abstractInterceptor.notify();
}
} catch (Exception e) {
result = "error";
}
}
public String getResult() {
return result;
}
}
}

Attachment:
user_204605.ezm (zipped)Honestly, this sounds like something that should be handled at the
application server level. What server are you using?
If you're using Tomcat via the Tomcat connector, take a look at reply
timeouts on [1].
If you're not using Tomcat, I'm sure there are similar options in other app
servers.
-Brian
[1] - http://tomcat.apache.org/connectors-doc/generic_howto/timeouts.html
On Mon, Jan 11, 2010 at 12:48 PM, Jorge Sousa
<jorge.sousa@(protected):
> Hi,
>
> First of all sorry for my bad english :)
> I need to implement a feature in my application, that will enable me to
> define the timeout of every request.
> I tried to create a Interceptor and put the main thread on wait, while
> other 2 threads, one will handle the time, and the other will make the
> invocation.invoke(). The first of this two threads to complete, will call
> the notify of the main thread and the correspondent result is returned.
>
> I tried this approach, but i get a null pointer exception in the thread
> that tried to execute the invocation.invoke().
>
> Is there any suggestions?
>
> If some one need more explanations, please let me know.
> You can find the code bellow.
>
> Thanks in advance,
> Jorge Sousa from Portugal
>
> Code:
>
> public class TimeoutInterceptor extends AbstractInterceptor {
>
> private static final ExecutorService threadPool =
> Executors.newCachedThreadPool();
>
> @Override
> public String intercept(ActionInvocation invocation) throws Exception {
> Invocator invocator = new Invocator(invocation, this);
> TimeoutWatcher timeoutWatcher = new TimeoutWatcher(this);
>
> threadPool.execute(invocator);
> threadPool.execute(timeoutWatcher);
>
> this.wait();
> if (invocator.getResult().equalsIgnoreCase("running")) {
> throw new TimeOutException();
> } else {
> return invocator.getResult();
> }
>
> }
>
> private class TimeoutWatcher implements Runnable {
>
> private AbstractInterceptor abstractInterceptor;
>
> public TimeoutWatcher(AbstractInterceptor abstractInterceptor) {
> this.abstractInterceptor = abstractInterceptor;
> }
>
> @Override
> public void run() {
> try {
> Thread.sleep(10000);
> } catch (InterruptedException e) {
> }
> synchronized (abstractInterceptor) {
> abstractInterceptor.notify();
> }
> }
> }
>
> private class Invocator implements Runnable {
>
> private ActionInvocation invocation;
> private String result = "running";
> private AbstractInterceptor abstractInterceptor;
>
> public Invocator(ActionInvocation invocation, AbstractInterceptor
> abstractInterceptor) {
> this.invocation = invocation;
> this.abstractInterceptor = abstractInterceptor;
> }
>
> @Override
> public void run() {
> try {
> result = invocation.invoke();
> synchronized (abstractInterceptor) {
> abstractInterceptor.notify();
> }
> } catch (Exception e) {
> result = "error";
> }
> }
>
> public String getResult() {
> return result;
> }
> }
>
> }
>
>
>
>
>
>