I use Javascript in Struts,like follows:
script language=JavaScript
function goURL(tmp){
alert(tmp);
document.forms[0].action=/log.do?action=+eval(tmp);
document.forms[0].submit();
}
/script
html:form method=post action=log.do
html:link page=/log.do?action=FirstFirst Page/html:link
html:select
:
document.forms[0].action=/log.do?action=+eval(tmp);
You'll need to prefix /log.do with your web context. Or you can use:
html:rewrite page='/log.do' / in place of /log.do above.
hope it helps.
Saul
- Original Message -
From: red phoenix [EMAIL PROTECTED]
To: user
with your web context. Or you can use:
html:rewrite page='/log.do' / in place of /log.do above.
hope it helps.
Saul
- Original Message -
From: red phoenix [EMAIL PROTECTED]
To: user@struts.apache.org
Sent: Sunday, February 19, 2006 6:48 PM
Subject: why my page can't redirect
it again with following manner.
html:select property=pageID size=1 onchange=javascript:goURL(
this.options[this.selectedIndex].value)
option value=FirstFirst/option
option value=SecondSecond/option
option value=ThirdThird/option
/html:select
I hope it will work.
On 2/20/06, red phoenix
= %=response.encodeURL(/Log/log.do)%;
document.forms[0].action=url + ?action= + tmp;
document.forms[0].submit();
}
and try...
On 2/20/06, red phoenix [EMAIL PROTECTED] wrote:
I modify my Javascript like follows:
function goURL(tmp){
document.forms[0].action=eval(/Log/log.do?action=First
can't redirect?
On 2/20/06, raja sekar [EMAIL PROTECTED] wrote:
try this
function goURL(tmp){
var url = %=response.encodeURL(/Log/log.do)%;
document.forms[0].action=url + ?action= + tmp;
document.forms[0].submit();
}
On 2/20/06, red phoenix [EMAIL PROTECTED] wrote:
when I
I tried follows:
function goURL(tmp){
document.forms[0].action=eval(/Log/log.do?action=First);
document.forms[0].submit();
}
and
function goURL(tmp){
document.forms[0].action=eval(/log.do?action=First);
document.forms[0].submit();
}
My page also can't redirect!
And I try
function
PROTECTED] wrote:
red phoenix wrote:
I tried follows:
function goURL(tmp){
document.forms[0].action=eval(/Log/log.do?action=First);
document.forms[0].submit();
}
and
function goURL(tmp){
document.forms[0].action=eval(/log.do?action=First);
document.forms[0].submit
I have a JSP file,and I use html:errors in this page,but it raise error,my
code is follows:
%@ taglib uri=/WEB-INF/struts-form.tld prefix=html %
html
head
link rel=stylesheet href=style.css type=text/css
/head
html:errors/
html:form method=post action=log.do
html:text property=abc /html:errors
; It should be name instead property
Hope this will help
Chandra
-Original Message-
From: red phoenix [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 23, 2006 12:48 PM
To: Struts Users Mailing List
Subject: html:errors question
I have a JSP file,and I use html:errors in this page
,and html:errors name=abc/ don't
work. I am puzzled with it.
On 2/23/06, Dave Newton [EMAIL PROTECTED] wrote:
red phoenix wrote:
I modify my code,like follows,this time it don't show any error,but when
the
content of text abc is '123',it's length isn't equals 10,so it should
raise
error
taglib tld:
%@ taglib uri=/WEB-INF/struts-html.tld prefix=html %
then there shouldn't be any problem with the property attribute. If
you're
using a pre 1.0 version of struts I highly recommend you upgrade.
Niall
- Original Message -
From: red phoenix [EMAIL PROTECTED]
Sent
See:
http://www.niallp.pwp.blueyonder.co.uk/HelpTagsErrorsAndMessages.html
Niall
- Original Message -
From: red phoenix [EMAIL PROTECTED]
To: Struts Users Mailing List user@struts.apache.org
Sent: Friday, February 24, 2006 2:30 AM
Subject: Re: html:errors question
Thanks Niall
I use Struts struts-1.2.8,when I execute my JSP file,it raise following
error:
javax.servlet.ServletException: Cannot find ActionMappings or
ActionFormBeans collection
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(
PageContextImpl.java:858)
for you!
2006/2/27, red phoenix [EMAIL PROTECTED]:
I use Struts struts-1.2.8,when I execute my JSP file,it raise following
error:
javax.servlet.ServletException: Cannot find ActionMappings or
ActionFormBeans collection
org.apache.jasper.runtime.PageContextImpl.doHandlePageException
I have configure my properties file,but when run,it raise error and say
can't find message key,my files are follows:
/*index.jsp*/
%@ taglib uri=http://struts.apache.org/tags-html; prefix=html %
html:form method=post action=log
..
html:errors property=logstime/
/html:form
=post action=/log try again?
2006/2/27, red phoenix [EMAIL PROTECTED]:
I use html:form method=post action=log
But it still raise same error.
On 2/27/06, Denis Ling [EMAIL PROTECTED] wrote:
html:form method=post action=log.do
table
...
/table
/html:form
You should
I have a simple Struts program,it can run well in Struts1.0.2,then I migrate
it to Struts1.2.8,this time I find index.jsp page shows well,but when I
submit this page,it should redirect to show.jsp page and show something in
it,but in fact it redirect an empty page,it show nothing,even no error in
where error is my code?
On 2/28/06, Laurie Harper [EMAIL PROTECTED] wrote:
First things first: did you go through all the migration steps listed on
the wiki for 1.0 - 1.2, 1.1 - 1.2.4, 1.2.4 - 1.2.7 and 1.2.7 - 1.2.8?
L.
red phoenix wrote:
I have a simple Struts program,it can run well
I use struts-1.2.9,and want to configure a connection pool,so I configure
struts-config.xml file
struts-config
data-source key=bb1 type=org.apache.commons.dbcp.BasicDataSource
set-property property=driverClassName value=
sun.jdbc.odbc.JdbcOdbcDriver /
set-property property=url
I configure a connection pool in Tomcat5.5.12,like follows:
Context path= docBase=/jsp-examples debug=5 reloadable=true
crossContext=true
Resource name=jdbc/bb1 auth=Container type=javax.sql.DataSource
maxActive=100 maxIdle=30 maxWait=1 username=administrator
password=123
I want to configure data source,I use Tomcat5.5.15 and struts-1.2.9,my
database is Microsoft Access2000,my configure is follows:
struts-config
data-sources
data-source type=org.apache.commons.dbcp.BasicDataSource
set-property
property=driverClassName
this,
DataSource db= getDataSource(request,key);
This should work for you. Let me know if you still face any issues.
Thanks,
Tarun.
On 4/1/06, red phoenix [EMAIL PROTECTED] wrote:
I use struts-1.2.9,and want to configure a connection pool,so I
configure
struts-config.xml file
My Struts is 1.2.9,and tomcat is 5.5.15,and JDK is 1.5,I want to use Struts
Datasource,my database is Microsoft Access 2000,and I have configured ODBC
datasource in windows,when I run it, it raise follows error:
type Status report
message Servlet action is not available
description The requested
javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
Why?
Any idea will be appreciated!
Best regards,
On 4/4/06, Craig McClanahan [EMAIL PROTECTED] wrote:
On 4/3/06, red phoenix [EMAIL PROTECTED] wrote:
My Struts is 1.2.9,and tomcat is 5.5.15,and JDK is 1.5,I want
I have a submit button in A.jsp,and I want to submit to B.do from A.jsp,but
when I click this submit button,it should submit to B.do and show some
information on screen,but in fact it doesn't work,when I use
http://localhost:8080/B.do, it can work.I don't know why it don't work from
A.jsp to B.do?
Is there a struts taglib document about html:??,bean:???,logic:???,the
chm file form is better. If you have it,please give it to me.
Thanks!
I want to realize download function in struts,and I will put some file url
in JSP file,when click one of the file url,this file will be
download.Dostruts or some taglib support download function?
Thanks in advance
I have two jsp file,such a.jsp and b.jsp,one Action file and one Form file,I
want to from a.jsp to call Action file,and I set value of Form in Action
file,and return to b.jsp,and show value in b.jsp,so I can modify this value
in b.jsp
my struts-config.xml is follows:
form-beans
form-bean
I want to use s:tree id=... rootNode=... nodeIdProperty=...
nodeTitleProperty=... childCollectionProperty=... /,I read
treeExampleDynamic.jsp of struts2 document,like follows:
script
function treeNodeSelected(nodeId) {
dojo.io.bind({
url: s:url
I have a text area and a text link in a jsp page,when I click this text
link,I will call struts2 action by using ajax,like follows:
/*-jsp page-*/
html
script type=text/javascript
var http = getHttpObject();
function getHttpObject(){
var xmlhttp = false;
if(window.XMLHttpRequest){
I want to set a filter,then I set different character code by this
filter,such when a request from a1.action,I will set this character code is
UTF-8,a request from a2.action,I will set this character code is
ISO88591,and so on.I don't know how to realize above function in filter?
Anybody could
Would you give me a simple code for it?
On 4/20/07, Drew Kutcharian [EMAIL PROTECTED] wrote:
Can you use different filters/filter mappings for different URL patterns?
Drew Kutcharian
Venarc Inc. www.venarc.com
- Original Message
From: red phoenix [EMAIL PROTECTED]
To: Struts
I want to use ajax in struts2,but when run my code like
http://localhost:8080/test/index.html,it raise following Javascript error:
Line:95
Char:1
Error:Could not load 'dojo.widget.html.Tooltip':last tried '__package__.js'
Code:0
I want to use ajax within Struts to realize following function,there is a
textfield an a submit button which use register a username in a JSP
page,then you can put you name into textfield and click register button,then
will call ajax to search name is exist,if exist,there will be a message
behind
when ajax receive information which include Chinese code from action of
Struts2,ajax will show chinese code into confusion code,but if ajax receive
information which include Chinese code from jsp, ajax will show correct
Chinese code.I don't know why raise this error! How to correct it?
My code
I have set my all files with UTF-8 format,so I set URIEncoding parameter in
server.xml in tomcat6.0.10,like follows:
Connector port=8080 protocol=HTTP/1.1
maxThreads=150 connectionTimeout=2
redirectPort=8443 URIEncoding=UTF-8/
Then I write a JSP file like follows:
I tried follows in test.do:
String name=request.getParameter(Name);
System.out.println(new String(name.getBytes(UTF-8), gb2312))
it still show [EMAIL PROTECTED],Why?
On 5/8/07, Christopher Schultz [EMAIL PROTECTED] wrote:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Red,
red phoenix wrote
and destroy the original
message without making a copy. Thank you.
- Original Message -
From: red phoenix [EMAIL PROTECTED]
To: Struts Users Mailing List user@struts.apache.org
Sent: Tuesday, May 08, 2007 8:47 PM
Subject: Re: Struts2 character code question
I tried follows in test.do:
String
I read document from struts2 and I know s:textfield has
label,name,cssStyle,cssClass,so I use s:textfield as follows:
s:textfield label=Your First Name name=Fname cssStyle=test
cssClass=test
I want to set label Your First Name as red color and font size is 6,but
when I execute above code,I found
I use JDK1.6,tomcat5.0.28,Struts1.2.9,I run Bundles Example
Formhttp://localhost:8080/struts-examples/validator/viewBundleExamples.do
of
struts-examples.war,when I click Save button,I find the Field Address
say [Other
Bundle]Missing Field: Address(Other Bundle)
Why raise above error? How to
I want to use struts validation,when field is invalidate,my program can
raise information,like follows:
Username is required.
Password is required.
Phone Number is required.
I know it's server-side validation,I want to use client-side validation,so I
put some code in my JSP files:
/html:form
I use JDK1.6 and Struts1.3.5,I use Javac to compile a Action file,like
follows:
javac xxxAction.java
but when I compile it,it raise follows error:
xxxAction.java:31: Can't find symbol
symbol: method getDataSource(javax.servlet.http.HttpServletRequest,
java.lang.String)
location: class xxxAction
I want to get a value from a JSP in Action,like follows:
/*jsp*/
%@ page contentType=text/html;charset=gb2312 %
html:text property=ex/
And I input a Chinese Word in ex area,then I get the ex value from a
Action,like follows:
/*Action*/
public ActionForward execute(ActionMapping
I want to realize print function in Struts,when click a button in jsp
page,it will print part of screen information in Printer. I know javascript:
window.print() can realize print function,but it don't fit me,because
window.print() will print all screen information.I know another method,it
will
I compile my Java file,but it raise error:org.apache.commons.validator not
found,I guess I must lost a jar file,but I don't know which jar I
lost,anyone could tell me which jar I need?
Thanks.
I am a newer of Struts 2,I find my application of Struts1 are can't run
under Struts 2.I want to know Struts 2,but I don't know how to learn
Struts2,would you give me some advice or material to learn?
Thanks
I have a question about Struts 2.0 Action,I find Action will extends
ActionSupport,like follows:
public class GetUpdatedHangmanAction extends ActionSupport implements
SessionAware {
private static final long serialVersionUID = 5506025785406043027L;
.
I am puzzled with variable
I have a filter configure question about struts2,i want to filter character
code in web.xml file,I know how to configure it in struts 1.3,
C:\tomcat\webapps\exercise\WEB-INF\web.xml
...
filter
filter-nameSet Character Encoding/filter-name
I am puzzled with struts2.0 action file,my files are follows:
configure file is follows
action name=createRoom class=crudRoomAction method=create
result name=read/chat/read.jsp/result
result name=write/chat/write.jsp/result
/action
action file is follows:
public String execute() throws
I want to set other country language character set,I know I should set
web.xml with struts.i18n.encoding=...
but I don't know the value which struts.i18n.encoding permited,anyone could
give me a character list of struts.i18n.encoding?
Thanks
I want to realize logic:present in Struts2,when session attribute is
exist,it show login,if it is not exist,it shows not login,like follows:
logic:present name=test
login
/logic:present
logic:notPresent name=test
not login
/logic:notPresent
I don't know how to use logic:present in
I put a String into a session,and I use s:if to determine the session if
it is exist,if exist,show OK,if not exist,it shows error,but when I run
it,it shows error,I don't know why don't show OK? How to correct to show OK?
my code is follows:
%@ page contentType=text/html; charset=UTF-8 %
%@
I want to change my code from struts1 to struts2,I use displaytag and
bean:write to show following code,it can run well,bean:write
name=element property=ID/ will show 1,2,
%@ taglib uri=/struts-tags prefix=s %
display:table name=testList export=false sort=external
defaultsort=1 pagesize=2
In struts doc,I often see org.apache.struts2.example.*,I want to know
where I can download the example fiels?
I use struts2 s:bean,like follows:
---SimpleCounter---
package test;
public class SimpleCounter{
String foo;
public void setFoo(String foo){
System.out.println(set foo=+foo);
this.foo=foo;
}
public String getFoo(){
System.out.println(get foo=+foo);
return foo;
}
}
---test.jsp---
%@ taglib
-Original Message-
From: red phoenix [mailto:[EMAIL PROTECTED]
Sent: 19. joulukuuta 2006 9:49
To: Struts Users Mailing List
Subject: where to download struts2.0 examples files?
In struts doc,I often see org.apache.struts2.example.*,I want to know
where I can download the example fiels
When I start tomcat6 and struts2,sometimes when I start tomcat,it will raise
following error,but sometimes when I start tomcat6,it don't raise any error!
I am puzzled with it for a very long time!!! Anyone could tell the reason
and how to solve it?
Error information is following:
Exception
I have some configure,and it runs well under struts2.0.9,but it raise
warning under struts2.0.11,my files are follows:
/*struts.xml*/
?xml version=1.0 encoding=UTF-8 ?
!DOCTYPE struts PUBLIC
-//Apache Software Foundation//DTD Struts Configuration 2.0//EN
I use Struts2 and displaytag, In testList,there is a abc attribute,it
contains data like english,france,when abc=english,I want to show
En,else show Eu,my code is follows:
display:table name=testList id=element size=6
display:column property=abc title=def
s:if test= #element.abc=='english'
I use struts2.0.11, I use Hibernate to get data and put it into attribute in
struts2 action,like follows:
public String show() throws Exception{
request=ServletActionContext.getRequest();
List myList=this.getHibernateTemplate().find(from test.MyModel);
request.setAttribute(myList,myList);
I want to use jsp:include to load my struts file,such as:
jsp:include page=/a1.do /
jsp:include page=/a2.do /
but when I run this jsp file,http://localhost:8080/a.jsp,it raise
error,it shows it can't find a1.do and a2.do,but when I write follows in IE,
http://localhost:8080/a1.do, it
,like follows:
c:import url=
http://localhost:8080/struts2-blank-2.0.8/example/HelloWorld.action/
I only want to use relative path,not absolute path,I don't know why raise
above error,and how to correct it ?
Thanks
On 7/12/07, Michael Jouravlev [EMAIL PROTECTED] wrote:
On 7/11/07, red phoenix
For general Java class,we can make construction function,like this:
public class test{
String a;
public test(String a){
this.a=a;
}
}
I don't know if I can do it like above code under struts2 action,for some
reason,I want to initialize some variable and assign some value to it,like
If I use no-argument constructor,how can i do to initialize some
information?
Thanks
On 8/16/07, Rec Floyd [EMAIL PROTECTED] wrote:
Hey,red.In my opinion, to use struts, you have to supply a no-argument
constructor.That is the point.
if this is what you are after though
Why do you want to do this ?
Leon
red phoenix wrote:
If I use no-argument constructor,how can i do to initialize some
information?
Thanks
On 8/16/07, Rec Floyd [EMAIL PROTECTED] wrote:
Hey,red.In my opinion, to use struts, you have to supply
://struts.apache.org/2.x/docs/spring-plugin.html
Nils-H
On 8/16/07, red phoenix [EMAIL PROTECTED] wrote:
I know your meaning,but the question I want to Initialize in struts
action,not in common class,because I want to get WebApplicationContext
in
struts action,and then I will transfer WebApplicationContext
I want to know how to get directory information in struts2 action,when I run
following action:
http://localhost:8080/struts2-blank-2.0.9/example/HelloWorld.action
I want to get the path value http://localhost:8080/struts2-blank-2.0.9 in
HelloWorld.action,such as:
public String execute() throws
I use Tomcat6.0.14 and struts2,I have a jsp page,and there is a button in
it,when I click this button,it will call Javascript,and redirect another
page,my code is follows:
...
functioin test(){
document.forms[0].action=a.do;
document.forms[0].submit();
}
...
s:form
table
tda
I use struts2.0.9 and displaytag,xwork-2.0.4.jar,when I click next page of
displaytag,it will raise flowing warning:
Warn: ParametersInterceptor - [setParameters]: Unexpected Exception caught
setting 'd-1332698-p' on 'class Test.TestAction: Error setting expression
'd-1332698-p' with value
I want to use Pager Tag Library2.0 in struts2,I set maxPageItems under
struts2.0 action,like follows:
request.setAttribute(maxPageItems,10);
return SUCCESS;
then I use maxPageItems in JSP page,like follows:
pg:pager
items=50
index=center
maxPageItems=${request.maxPageItems}
I use struts2.0.11,I want to show a picture by struts action,like follows:
public String showphoto() throws Exception{
response=ServletActionContext.getResponse();
response.setContentType(image/png);
...
InputStream in = picture.getBinaryStream();
OutputStream out =
I want to upload a file in struts2,my jsp file is follows:
html:html
body
s:form enctype=multipart/form-data method=post action=upload.action
s:file id=uploadFile name=uploadFile accept=text/*/
input type=submit
/s:form
/body
/html:html
my action is follows:
import java.io.File;
private File
puzzled with why raise above error. I don't find the different
between my code and
http://struts.apache.org/2.0.14/docs/how-do-we-upload-files.html.
Where wrong with my code?
On Tue, Dec 16, 2008 at 11:13 PM, Dave Newton newton.d...@yahoo.com wrote:
--- On Tue, 12/16/08, red phoenix wrote
I use struts2.0.14,I want to use upload function,my jsp file is follows:
s:form enctype=multipart/form-data method=post
s:file name=upload label=File accept=text/* cssStyle=width:260px/
...
s:form
struts action is follows:
public String uploadFile() throws Exception{
MultiPartRequestWrapper
are not the same machine. How to do it? An example is better.
phoenix
On Tue, Dec 16, 2008 at 11:32 PM, Dave Newton newton.d...@yahoo.com wrote:
Use the *preferred* method, the interceptor.
I haven't looked in to what caused the breaking change.
Dave
--- On Tue, 12/16/08, red phoenix rodphoe...@gmail.com
interceptor?
phoenix
On Tue, Dec 16, 2008 at 11:55 PM, Dave Newton newton.d...@yahoo.com wrote:
--- On Tue, 12/16/08, red phoenix wrote:
It says: Ensure that {{fileUpload }} Interceptor is included in the
Action's stack. .*The default stack already includes {{fileUpload }}.*
I don't know how
My Struts is 2.0.14,I use s:file,like follows:
s:file name=upload label=select file accept=text/*/
Then there is a upload button,but this button is not pretty.I have two
question:
1) How to decorate this button,such as a image button?
2) when I click this button,how to check this upload file
I use struts2.0.14 and Pager Taglib2.0, I want to use Pager Taglib2.0 in
struts2
In action file
public String search() throws Exception{
System.out.println(call search);
request.setAttribute(index,center);
request.setAttribute(pageUrl,/test/search.action);
return SUCCESS;
}
I use struts2 and Pager Taglib2.0, in jsp file,it has a parameter,like
follows:
input type=hidden name=pager.offset value=%= offset %
when I run above code,it raise warning message:
Warn: ParametersInterceptor - [setParameters]: Unexpected Exception caught
setting 'pager.offset' on 'class
I have a table named mytable,it has two cols,col1 and col2,the data are
col1 col2
---
John 24
Kate 18
hibernate xml file is follows:
hibernate-mapping auto-import=false
class name=mytable table=mytable
id name=col1 column=col1 type=java.lang.String
generator
I want to use legend tag under struts2,I set legend css like follows:
form{
padding:10px;
margin:0 auto;
}
form#form legend {
border:1px solid #e8e7e1;
background:#fff url(../img/form_red.gif) repeat-x center left;
color:#a43708;
}
following code can run well:
h3 id=adduser style=width:100%;Add
I have a jsp,it contains a s:select,like follows:
s:select name=test list=#request.testList listKey=id
listValue=tname size=6 cssClass=tbcell/
When this jsp submit,it will submit to a struts2 action,I want to know how
to get all id and name of s:select and how to get selected id and name of
I want to use Struts 2 + Spring 2 + JPA + AJAX,I find it as following url:
http://struts.apache.org/2.1.8/docs/struts-2-spring-2-jpa-ajax.html
When I try to download this code,like follows:
Get the
I use struts2.1.8 and extjs3.2, I make a login page, if login
failed,it will alert a message and it will still stay this login page;
if it login success,it will go to another new page,such as main.jsp
page
My login page is follows:
var win=new Ext.Window({
el:'hello-win',
items:
85 matches
Mail list logo