Re: [OT] Re: Best Tool to develop html pages

2008-02-05 Thread Lukasz Lenart
Maybe not the best, but very good - MyEclipse


Regards
--
Lukasz

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



Re: Multiple submit buttons in a single JSP

2008-02-07 Thread Lukasz Lenart
Hi,

You can use
s:submit value=Save method=save/
s:submit value=Update method=update/
s:submit value=Show method=show/

and Action class with three methods, the same like execute()

http://struts.apache.org/2.x/docs/submit.html


Regards
--
Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Re: Basic setup question (tiles 2)

2008-02-11 Thread Lukasz Lenart
Did you follow docs configuration as in
http://struts.apache.org/2.x/docs/tiles-plugin.html ?


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Re: Basic setup question (tiles 2)

2008-02-11 Thread Lukasz Lenart
It is better to add dependency for Tiles plugin, it will download all
needed jars for you:

dependency
groupIdorg.apache.struts/groupId
artifactIdstruts2-tiles-plugin/artifactId
version2.0.9/version
/dependency

Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Re: [OT] Re: Javascript problem

2008-02-11 Thread Lukasz Lenart
Did you put such code inside page header's tags?


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Re: Javascript problem

2008-02-11 Thread Lukasz Lenart
Try to put your JavaScript in page header and use onload

header

script
window.onload = function() {
  alert('hi');
  alert(document.getElementById('id'));
}
/script
/header


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Re: Source for Struts Tiles Plugin?

2008-02-12 Thread Lukasz Lenart
Hi,

By default, Tiles2 use tiles.xml, you can add additional config files
via DEFINITIONS_CONFIG -
http://tiles.apache.org/config-reference.html
Please check also DTD for tiles.xml, it was changed.


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Re: Struts + Maven + Eclipse problem

2008-02-12 Thread Lukasz Lenart
Set package namespace to /

package name=default extends=struts-default namespace=/


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Re: Basic setup question (tiles 2)

2008-02-12 Thread Lukasz Lenart
Thanks for clarification!


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Re: Basic setup question (tiles 2)

2008-02-12 Thread Lukasz Lenart
Hi,

I've probably found  the problem, struts-tiles-plugin doesn't depend
on tiles-jsp. You have to manually added it your pom.xml, like below:

dependency
groupIdorg.apache.tiles/groupId
artifactIdtiles-jsp/artifactId
version2.0.4/version
/dependency

when you using Struts 2.0.9 - tiles version is 2.0.4. I think the pom
for struts-tiles-plugin should contain such dependency, it looks like
a bug (or maybe I'm wrong)?


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Re: struts2+Spring+Hibernate Integration

2008-02-21 Thread Lukasz Lenart
Hi,

Download Spring 2 libraries and put in your WEB-INF/lib folder


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Re: Struts 2 and SOA

2008-02-26 Thread Lukasz Lenart
Hi,

I think, it will be better if try to use XFire / CXF or Axis2, you can
create simple POJO and expose it as WebService and from the other side
you can use such POJO in your Struts2 actions. And of course you can
use Spring to initialize it and inject to your actions ;-)
If you want to have better interoperability with .NET you should
consider using literal/document style for your WebServices (base on
XSD and XML messages).


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Re: Struts 2 and SOA

2008-02-26 Thread Lukasz Lenart
Hi,

It is too complex to answer in one post ;-), but you almost answer all
your questions ;-)
I don't know all the details about your system (will it be base on
some J2EE App server?), but for example:
- you can implement all your core business logic as simple POJO's base
on Spring, it will allow you to test them in separation from the
client code
- for web tier you can use Struts2 and also use Spring to connect your
actions to POJO's  above,  ... MyAction.save() would go into
POJO.save() ...  - exactly, and you can use some Transfer Object
between action and POJO (you should not expose your entities to
actions, repack them to POJO ;-)
- even if don't plan to have interoperability with .NET you should use
with your WebServices literal / document style (base on XSD and XML),
then you can implement your WebService as a POJO, which will map in /
from  XML request to Transfer Object which will be used with
POJO.save()
- when you will want to use J2EE server, you can inject your POJO's
with Spring to EJB's (
http://static.springframework.org/spring/docs/2.5.x/reference/ejb.html#ejb-implementation-ejb3
) and once again pack your entities to TO (but it can the same TO for
all tiers)

As you can see, you can simple extend access to your business logic,
base on different technologies.

If you want to connect does two systems, especially over the network,
SOA can be a good solution. You can simply separate the logic of both
and extend them independently, exposing new functionality through
WebServices. But SOA is not a magic, you will encounter another
problems when you will try to implement SOA (authorization,
versionning,
problems exposing complex objects / data, etc)

I've hope that will give you some brief review how I see it ;-)


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Re: good tutorial recommendation

2008-02-29 Thread Lukasz Lenart
Hi,

You can use also maven2 (2.0.8)

mvn archetype:create

and you will have some option to chose (8, 19-23)


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Re: Problem with returning SUCCESS from execute

2008-03-04 Thread Lukasz Lenart
  *class* StrutsExample {

Your class should extend ActionSupport or return Action.SUCCESS (not SUCCESS)


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Re: DispatchAction nonexisting method

2008-03-06 Thread Lukasz Lenart
Hi

Subclass the DispatchAction and override getMethod() like below


Method getMethodName() {
  Method method = super.getMethod();
  if (method == null) {
method = clazz.getMethod(unspecified, types);
  }
  return method;
}


Regards
--
Lukasz

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



Re: Preserve datas in form

2008-03-06 Thread Lukasz Lenart
Hi,

How do you forward to jsp, simple forward or maybe redirect? Could you
give some example?


Regards
--
Lukasz

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



Re: [S2] Mapping a result string for all the actions

2008-03-10 Thread Lukasz Lenart
Hi,

You can use global-results
http://struts.apache.org/2.0.6/docs/result-configuration.html


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Re: accessing path_info

2008-03-12 Thread Lukasz Lenart
Hi

Maybe this will help

http://www.lunatech-research.com/archives/2005/07/29/struts-urls


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

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



[S2] Maven2 and validation.xml

2008-03-12 Thread Lukasz Lenart
Hi,

I'm using maven2 to build my Struts2 application and how to solve the
problem with coping *-validation.xml files to target directory?

All my *-validation.xml files are next to action classes, in the same
package / directory (src/main/java/pl/org/lenart/s2) but they are no
copied in to target directory.
Yes, I can move them to resource

-- 

Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Re: [S2] Maven2 and validation.xml

2008-03-12 Thread Lukasz Lenart
 Resource files are supposed to be in the resources folder... Just put
  them there with the same path as your java class, and everything
  should be copied where it's supposed to. If that does not fit your

Yes, I did that but I was wondering how it should be, the good
practice in case of Struts 2. I think, it should be added to
archetype:create to expose such practice.


Any way thanks and regards
--
Lukasz

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



Re: Exception in Validation

2008-03-16 Thread Lukasz Lenart
Hi,

How do you start your project? With maven2 maybe? The xml file have to
be in the same output directory, next to compiled class. If you use
maven2, put your xml in to folder resources with the same path as for
action class.


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Re: Exception in Validation

2008-03-16 Thread Lukasz Lenart
Ok, check if xml file is in WebRoot/WEB-INF/classes/path


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Re: Struts2 Annotation based Validation

2008-03-17 Thread Lukasz Lenart
Hi,

Error messages are stored in request, you have to subclass
ActionSupport and add some mechanism to store messages in session.


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Re: Struts2 Annotation based Validation

2008-03-17 Thread Lukasz Lenart
 In Struts2 error messages are stored in the ValueStack in an object

Yes, I made mistake, I've mean in request scope, not in request object ;-)


Regards
-- 
Lukasz

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



Re: Struts2 Annotation based Validation

2008-03-18 Thread Lukasz Lenart
  But when I enter the value in the textbox and click submit again, the
  validation error for next is displayed correctly but entered value
  disappears in the textbox which is abnormal .

Maybe you are redirecting to the next page? Could you paste snippet
for your struts.xml and jsp?


Regards
-- 
Lukasz

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



Re: Custom validation with Struts2

2008-03-18 Thread Lukasz Lenart
  request = ServletActionContext.getRequest();
  String tmp = ;
  try {
tmp = request.getParameter(cardNo);
Integer i = this.getCardNo();
if (tmp != null  tmp.length()  0) {
  int tmpInt = Integer.parseInt(tmp);

Remove this part above

  this.setCardNo(tmpInt);

You don't have to do this, it will be done by Struts2

  System.out.println(Card no (validation) =  + 
 cardNo);
  if (cardNo  1 || cardNo  99) {
   addFieldError(cardNo, Must be int);
   System.out.println(INPUT...);
  }

That's all you have to have in your validate() method (if cardNo has
getter and setter defined in action class)
Remove also validate=true from your form, because you don't use client
side validation.


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Re: Struts2 Annotation based Validation

2008-03-18 Thread Lukasz Lenart
  form name=myForm method=post action=MyAction.do validate=true/
  tr
 td 
 width=115First Name/td
 td 
 width=142input type=text name=firstName id=firstName
  class=form_field/td

 td

 
 s:fielderror
   
 s:paramfirstName/s:param
 
 /s:fielderror
 /td

But as I see, you don't use s:textfield for your form and that's way
you don't see values in the form. If you want to add html tags as
above, use theme=simple and s:textfield


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Re: Struts2 Annotation based Validation

2008-03-18 Thread Lukasz Lenart
 tds:password name=pwd label=Your Password//td

By default s:password tag don't shows value of your password, you can
change such behaviour by adding attribute showPassword=true, but you
should consider security issue.


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Re: Custom validation with Struts2

2008-03-18 Thread Lukasz Lenart
I'm not sure were is the problem but I've just checked such simple
example below and everything is ok. Maybe you should consider to use
Long instead of Integer, because when you enter more then 2147483647
to the field you will get some strange value back to the input
(because you loose precision ;-)

class EmployeeAction extends ActionSupport {

private Integer cardNo; // getter  setter

 public void validate() {
if (cardNo == null) {
addFieldError(cardNo, Should be integer!);
} else if ( cardNo  1 || cardNo  99) {
addFieldError(cardNo, Should be integer!);
}
}

}

JSP

s:textfield label=Card Number name=cardNo /


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Re: About ActionErrors.GLOBAL_ERROR

2008-03-19 Thread Lukasz Lenart
Hi,

Maybe something like this:

logic:messagesPresent name=%=Globals.ERROR_KEY%
table width=480 id=ErrorsTableId class=ErrorsTable
html:messages id=error name=%=Globals.ERROR_KEY%
  tr
tdbean:write name=error //td
  /tr
/html:messages
/table
/logic:messagesPresent

logic:messagesPresent name=%=Globals.MESSAGE_KEY%
table width=480 id=MessagesTableId class=MessagesTable
html:messages id=message message=true
  tr
tdbean:write name=message //td
  /tr
/html:messages
/table
/logic:messagesPresent

logic:present name=%=Globals.EXCEPTION_KEY%
table width=480 id=ExceptionTableId style=display: none
class=ExceptionTable
  html:messages id=exception name=%=Globals.EXCEPTION_KEY%
  tr
td
  bean:write name=exception /
/td
  /tr
  /html:messages
/table
/logic:present


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Re: sorry for this test

2008-03-19 Thread Lukasz Lenart
  email. But apparently the email didn't got to the users, i haven't received
  it.

That's how it works! You will don't get your emails back, but any else
will get ;-)


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Re: File Upload Size

2008-03-19 Thread Lukasz Lenart
Hi,

You can subclass FileUploadInterceptor and override acceptFile(File
file, String contentType, String inputName, ValidationAware
validation, Locale locale) method


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Re: File Upload Size

2008-03-19 Thread Lukasz Lenart
Does your action implements ValidationAware interface?



Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Re: File Upload Size

2008-03-20 Thread Lukasz Lenart
 No it doesn't

Maybe that's the problem, FileUploadInterceptor check if action
implements it and add error messages. If you implement it, remember to
add result name=input.


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Re: Best Pratices for Access Restriction and Authentication?

2008-03-20 Thread Lukasz Lenart
  I just read bout about Acegi (http://www.acegisecurity.org/). As far as i
  understand this framework would provide mechanisms for authentication and
  authorization (which also will be going to be a topic in a later project
  stage). In its documentation i read that it's working with spring. Does this
  only refere to Spring für DI, so i would be able to use Acegi also for
  authentication in my Struts2 application (which already uses Spring for DI)
  or does it only work with Spring Actions?

It works very well with Struts2 or with any other web framework, even
there is some example how to develop Struts2 Interceptor in inject
Auth context to an action.


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart


Re: Struts2 Annotation based Validation

2008-03-26 Thread Lukasz Lenart
  Is it possible for me to have multilingual Validations using Annotation
  Based Validations in Struts2 ?

Yes, you can, just add key = some.error.message to your annotation, like below

@RequiredStringValidator(key = some.key)
public void setFirstName(String firstName) {
this.firstName = firstName;
}


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Re: Struts2 Annotation based Validation

2008-03-26 Thread Lukasz Lenart
Hi,

You mess too many thing, please try like this:

 @RequiredStringValidator(key = error.required, message = Please
enter a value for First name)

error.required = ${fieldName} is required!



Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Re: s:if Problem

2008-03-26 Thread Lukasz Lenart
  s:if test=%{kzAuftr == Constants.ORDER_STATUS_EMPTY }

s:if test=%{#kzAuftr == @[EMAIL PROTECTED] }

and check this link, section Accessing static properties
http://struts.apache.org/2.x/docs/ognl-basics.html


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Re: Struts2 Annotation based Validation

2008-03-27 Thread Lukasz Lenart
   Im not sure where to place my properties file.

I almost always put my messages to file named package.properties in
the same folder as my action's classes.


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Re: Client Side Validation with Struts

2008-03-29 Thread Lukasz Lenart
Hi,

Could you be more specific, which Struts version? If you use onsubmit
event, you should do that like this:

onsubmit=JavaScript: return validate();

where validate() has to return true or false.


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Re: Client Side Validation with Struts

2008-03-31 Thread Lukasz Lenart
  Hello. I am using Struts 1.3.8. The issue is not one of making the
  Javascript work (it is working correctly), but rather preventing a
  Struts action from being called. Is this possible given that the
  action of a form is a Struts action?

I'm not sure if I understand you, but all you have to do is return
true or false from your JavaScript function (as you doing), and that
will prevent a web browser to submit form and send them to a www
server. And if there be no request from web browser, there be no
action called.
Please copy/paste the web page content you had got when you started your form.


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Re: Help with tutorial

2008-04-02 Thread Lukasz Lenart
Hi,

  org.hibernate.AnnotationException: java.lang.NoSuchMethodException:

As for me, such fragment says that you maybe made some miss typo with
method name, in class or in Spring xml file


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Re: Actionerrors the Store Interceptor

2008-04-02 Thread Lukasz Lenart
Hi,

I think the best solution is to develop two Interceptors, one will run
after action invocation and will store messages in session or some
other objects from given request key. And second one, which will be
run before action invocation, that will retrieve such stored messages
from session and put them in to the request.

We have some similar solution but for Struts1. We subclassed
DispatchAction and after invocking execute() method we storing in
session messaged from given request key. And before next execute(), we
are checking such key in session and retrieving them back to the
request.


Regards
-- 

Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Re: Actionerrors the Store Interceptor

2008-04-02 Thread Lukasz Lenart
 Umm, that's what the Store Interceptor is.

Not exactly, you have to specify for which action store the messages,
and for which retrieve them back. There is no magic, everything hand
coded ;-)


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Re: xml based validation vs Annotations based validation

2008-04-03 Thread Lukasz Lenart
Hi,

 Wanted to get opinion from the struts2 user community if there are any
 advantages/disadvantages of using one approach over another (Xml vs Annotation
 based validation).

Nope ;-)

There is no one good answer for your question, because it depends ;-)
For me, the best thing is, you can combine all this two approach
together and even more, add method base validation (validate() and
validateXXX() ) to this stack.

I made some small test app to show such approach, you can download it
from here http://jdn.pl/files/test-app_0.zip (the site is in Polish
;-)


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Re: Security @ Struts2, using Acegy or Inspector

2008-04-03 Thread Lukasz Lenart
Hi,

  so, if I extend this action, the action will query and get security
  permission from database.. because i prefer database driven ..

You can do this with Acegi and even combine database with LDAP or with
something else.
I have used such solution in my projects.

  but i thinking a interceptor, but new in this area, i prefer a pattern that
  filter any action

Here you have simple solution how to integrate Acegi with Struts2
http://struts.apache.org/2.x/docs/can-we-use-acegi-security-with-the-framework.html


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Re: [S2] Struts with Web Services

2008-04-03 Thread Lukasz Lenart
Hi,

  1. Is this login web service something that is actually commonly used?

Yes and no, mainly because WS is session-less and you have to manage
the session token by your self. We use such approach internally,
through ssl and we manage session expirations by hand.

  2. Is this what a web service actually is, or am I applying that term where
  it doesn't belong?

In my opinion, if you don't have global SOA architecture /
specification / whatever it can be what ever you want, but without
clear path it can be mess in the near future.

  3. Is Acegi flexible enough to use in a setup like this?

I think yes, you can extend almost everything / re-implement all the
classes and customize them to do what you want.

  4. Is there enough additional complexity in setting up a system like this
  that it would also make sense to look into just duplicating the
  configuration for each webapp?

If you will have common template / approach / guideline there be
nothing more just to setup individual settings for each webapp. In
other case, you will all the time invite the wheel.

  5. Are there any good books, web tutorials, etc that talk about this?

Google? IBM alfa works site ? ;-)

  I guess what I'm basically looking for is a little design direction,
  possibly other technologies that provide these services so I'm not trying to
  build an entire system from scratch.

I thing you should start building your SOA strategy and how to fit it
to your current projects / structure. It's better to thing twice.


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Re: [S2] Struts with Web Services

2008-04-04 Thread Lukasz Lenart
  http://www.ja-sig.org/products/cas/

  -Wes

Do you have some experience with that? It looks quite interesting ;-)


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Re: Tiles in 1.3.9

2008-04-04 Thread Lukasz Lenart
Hi,

  struts-config
 action-mappings
 action path=/baselayout
 forward=.tiles-defs/
   /action-mappings

  tiles-defs.xml
   definition name=.tiles-defs path=/jsp/baseLayout.jsp

There is good practice to start Tiles definitions with dot - .tiles-defs
I don't see ant forwards in your struts-config.xml, could you past them here?


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Re: struts.xml

2008-04-09 Thread Lukasz Lenart
 Well this give me some info, but for example
  it does not explain what all the valid values of the type attribute are
  and what each value means.

  Is this documented anywhere ?

Look into the struts2-core.jar and find struts-default.xml, that will
give more information, then you can look here:
http://struts.apache.org/2.x/docs/result-types.html


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Re: Local Host Error

2008-04-10 Thread Lukasz Lenart
 Hello. To preface I am very new to using Apache. I am attempting to
  experiment locally, however I cannot connect to local host nor the
  127.0.0.1 directly. I am looking to try and get the IT works! Apache

Are you using Skype? By default, Skype block port 80 and 443, disable
such port in Skype or change the default port for Apache.

You can also use netstat -b from command prompt to see all programs
with opened ports.


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Re: Most popular classes to be used in Struts

2008-04-10 Thread Lukasz Lenart
Hi,

Some home work? ;-)

  What are the most popular classes to be used in Struts?

ActionSupport?


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Re: Most popular classes to be used in Struts

2008-04-10 Thread Lukasz Lenart
 ActionSupport?

Ugh... sorry this came from xwork ;-)


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Re: how to handle an action with parameter?

2008-04-10 Thread Lukasz Lenart
Hi,

Define setter setCategory(String value) for NewsAction


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Re: POJO Action Class

2008-04-12 Thread Lukasz Lenart
  Error says : Action class not found

Could you show your struts.xml?


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Re: POJO Action Class

2008-04-12 Thread Lukasz Lenart
Class and config looks ok, could paste the whole stack trace? When you
get such error, when starting conatiner or when requesting the action?
Could you also show how you call the action in web browser?


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Re: POJO Action Class

2008-04-12 Thread Lukasz Lenart
 Look carefully at the first line of the output.  You have misspelled User.

   (*Chris*)

Exactly,

action name=LoginUser class=com.prayog.apps.LoginUesr 

You have better eye then my :D


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Re: POJO Action Class

2008-04-12 Thread Lukasz Lenart
Hi,

Try to look into
C:/ide/eclipse/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/HelloWorld/WEB-INF/classes/

and see if you have there compiled class in package com.prayog.apps.LoginUser


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Re: POJO Action Class

2008-04-12 Thread Lukasz Lenart
 no only java file is there!!

Source file shouldn't be there, but in src folder. I don't know how
WTP works, but it looks it's a  configuration problem. Sorry I can't
help you.


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Re: Problems with default-action-ref (I was sent this message before with wrong subject...)

2008-04-13 Thread Lukasz Lenart
  This ocurred with someone too?

No, for me works like charm, maybe because I'm using 2.1.1-SNAPSHOT ;-)

default-action-ref name=index/

!-- base action, which will redirect to user defined default page --
action name=index
class=pl.org.lenart.ems.struts2.actions.IndexAction
result type=redirectAction${redirectName}/result
/action


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Re: Problems with default-action-ref (I was sent this message before with wrong subject...)

2008-04-13 Thread Lukasz Lenart
Hi once again and to clarify

  default-class-ref

is used when you did not specified the class for you action like below:

action name=index
  result type=index/index.jsp/result
/action

  and
  default-action-ref

is used when Struts could not find the action name for given http request, e.g

http://localhost/struts2/


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Re: Problems with default-action-ref (I was sent this message before with wrong subject...)

2008-04-13 Thread Lukasz Lenart
 That's why I re-opened the bug for S2.0.

As I understood, only for S2.0, because for 2.1 the tag
default-action-ref is working fine (I already test it)?


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Re: Problems with default-action-ref (I was sent this message before with wrong subject...)

2008-04-14 Thread Lukasz Lenart
  the s2.1 version is only avaiable from subversion?

If you using Maven, you can Apache Snapshot repo
http://people.apache.org/repo/m2-snapshot-repository/

or download struts2-blank.war from here
http://people.apache.org/repo/m2-snapshot-repository/org/apache/struts/struts2-blank/2.1.1-SNAPSHOT/struts2-blank-2.1.1-SNAPSHOT.war


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Re: action not getting called from struts-config

2008-04-14 Thread Lukasz Lenart
  When i invoke /sendmail action, nothing is shown..I mean it displays only

Maybe /sendmail.do will better? How did you map struts servlet in web.xml?


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Re: [S2] Selecting value in radio elements

2008-04-16 Thread Lukasz Lenart
Hi,

After some experiments, I found the solution:

s:radio list=#{'Y':'Yes','N':'No'} name=r2 
s:param name=valueN/s:param
/s:radio

Just look into riadiomap.ftl template and everything will be clear
(especially for Freemarker developers ;-)


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

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



Re: Problem with Validation framework

2008-04-24 Thread Lukasz Lenart
 action name=LookupUser
 class=com.intuit.sbfw.action.mc.UserLookupAction


UserLookupAction-validation.xml is in the same path as class above?


 2) I see this message when I invoke my very first action: INFO
  [ActionValidatorManagerFactory] Detected AnnotationActionValidatorManager,
 initializing it...
 Does this mean that I have to use Annotation only to configure the
 validation rules and I cannot use the xml approach?


No, you can, but you can also use in the same time xml base validation


 3) What could be wrong with my setup so that my validation classes are not
 working?


Check if xml file is in the same path when you deploy your application. Do
you use maven2?


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart


Exclude interceptor

2008-04-29 Thread Lukasz Lenart
Hi,

Today I've been presenting Struts2 to member of Warsaw JUG and I got such
question:
it is possible to exclude interceptor for given action?

As I know no, but maybe I'm wrong. The only way is to define interceptor for
each action and omit for given one.


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart


Re: How to build Struts 2.0.11.1?

2008-05-08 Thread Lukasz Lenart
Hi,


 I'm unsatisfied that not all tests are ok but I'll look for that
 separately.


Probably you have problem with DataTimePickerTagTest, if yes, don't borrow,
there is some problem with Locale settings to parse data. I've tried to
figure what it is, but till now I don't know how to solve the problem. Maybe
someone who write this tag will be know.


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart
http://jdn.pl/blog/416
http://www.lenart.org.pl/


Re: Dojo taglib?

2008-05-13 Thread Lukasz Lenart
Hi,

To use the AJAX tags from 2.1 on you must:

Reading http://struts.apache.org/2.x/docs/ajax-tags.html, this claims


You should read much more careful


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart
http://jdn.pl/blog/416
http://www.lenart.org.pl/


Missing @Result in 2.1.x

2008-05-14 Thread Lukasz Lenart
Hi,

I'm trying to use annotation to configure my action, but as I noticed, is
only available in Struts 2.0.x. What about 2.1.x? The only option is to use
Codebehind plugin?


Thanks in advance
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart
http://jdn.pl/blog/416
http://www.lenart.org.pl/


Re: Missing @Result in 2.1.x

2008-05-14 Thread Lukasz Lenart

 Yes


;-)

So, than, how can I use different methods from my Action class? Is it
possible?


Thanks in advance
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart
http://jdn.pl/blog/416
http://www.lenart.org.pl/


Re: How to skip validation for a particular button

2008-05-19 Thread Lukasz Lenart

 I have 4 buttons in one page and I have written one validaton xml file like
 this :-

 action_class - validation.xml

 But for one specific button I want to skip validation process.

 Is there anybody know how to do that.


Do you have different methods for each button? If so prepare separated xml
files for each one you want to validate like below:

ActionClass-method-validation.xml

where method is the name from struts.xml (not the real method name in the
action's class)

or you can use @SkipValidation annotation for particular method;


Regards
-- 
Lukasz


Re: struts 2 radio tag selected default

2008-06-04 Thread Lukasz Lenart
Hi,

s:radio list=#{'true':'Yes', 'false':'No'} name=employee.active
value=%{employee.active}/

or

s:radio list=#{'true':'Yes', 'false':'No'} name=employee.active
value=true/


Regards
-- 
Lukasz
http://www.lenart.org.pl/


Re: After Visiting URL with Query String, Query String Appears on Every Link

2008-06-07 Thread Lukasz Lenart
Hi

2008/6/7 Pandolf [EMAIL PROTECTED]:

@s.url id=todayDashboardUrl action=encounters



Add includeParams=none to this tag or globally set
struts.url.includeParams=none in struts.xml or struts.properties


Regards
-- 
Lukasz
http://www.lenart.org.pl/


Re: [Struts2] Convention Plugin

2008-06-07 Thread Lukasz Lenart
Hi,

You have to configure struts to tell where your actions are:

filter
filter-nameaction2/filter-name

filter-classorg.apache.struts2.dispatcher.FilterDispatcher/filter-class
init-param
param-nameactionPackages/param-name
param-valueyour.package.actions/param-value
/init-param
/filter


Action class must pass such name convention ActionNameAction.class, eg.
EmployeeAction will be mapped as a employee.action,
namespace will be created base on package prefix, eg.
your.package.actions.employee.AddAction will give add.action in namespace
/employee
The same convention is for results, eg. if employee.action return success it
will be mapped to employee-success.jsp

I also have such settings in my struts.properties but I don't know which
version do you use
struts.convention.action.packages = you.package.actions
struts.convention.result.path = / -- where to search you jsp files



Regards
-- 
Lukasz
http://www.lenart.org.pl/


Re: Reading Application Resource saved as UTF8 file and showing polish characters in browser

2008-06-09 Thread Lukasz Lenart
Hi,

2008/6/9 Raghuveer [EMAIL PROTECTED]:

 Is it possible in struts to configure the controller to read the
 application
 resource file which is saved as UTF8 format?


You can use filter from Spring

filter
filter-nameencodingFilter/filter-name

filter-classorg.springframework.web.filter.CharacterEncodingFilter/filter-class
init-param
param-nameencoding/param-name
param-valueUTF-8/param-value
/init-param
init-param
param-nameforceEncoding/param-name
param-valuetrue/param-value
/init-param
/filter


filter-mapping
filter-nameencodingFilter/filter-name
url-pattern/*/url-pattern
/filter-mapping

It is possible to save the notepad file in UTF8 instead of ANSII.


If such notepad support UTF-8, you can use Notepad++ or JDK tool
native2ascii which will convert ANSII file to UTF-8, there is also ant task
available or many IDEs support such convertion in fly


Regards
-- 
Lukasz
http://www.lenart.org.pl/


Re: Parameter question

2008-06-09 Thread Lukasz Lenart
Hi,

2008/6/9 Stanley, Eric [EMAIL PROTECTED]:

 Dave,
Thanks. So if I understand you, I can set all my url's that
 don't use params to excludeParams, but leave the ones that use params
 alone? Also, where do I set the constant? Im sure its just me, but this
 doesn't seem like a wise usage of params in S2. Why would it be
 beneficial to append any parameters that are not explicitly coded?


in struts.properties
struts.url.includeParams = none

in struts.xml
constant name=struts.url.includeParams value=none/

in web.xml
filter
filter-namestruts/filter-name

filter-classorg.apache.struts2.dispatcher.FilterDispatcher/filter-class
init-param
param-namestruts.url.includeParams/param-name
param-valuenone/param-value
/init-param
/filter


http://struts.apache.org/2.1.2/docs/constant-configuration.html


Regards
-- 
Lukasz
http://www.lenart.org.pl/


Re: How to force a default locale in Struts2?

2008-06-09 Thread Lukasz Lenart
Hi

You can set constant
struts.locale=en_US

in struts.properties or struts.xml or web.xml

http://struts.apache.org/2.x/docs/strutsproperties.html


Regards
-- 
Lukasz
http://www.lenart.org.pl/


Re: Modifying session attributes in Struts 2

2008-06-10 Thread Lukasz Lenart
Hi,

I think the best solution is to implement SessionAware interface and
setSession() method, then you will either add or remove values from
map. Like below:

public class IndexAction implements Action, SessionAware {

private MapString,Object session;

public void setSession(MapString,Object session) {
this.session = session;
}

public String execute() {
session.put(key, Some Value);
return SUCCESS;
}

public String doCheck() {
return SUCCESS;
}
}

snippet from struts.xml

package name=myPackage extends=struts-default

action name=index class=pl.org.lenart.s2demo.IndexAction
result/jsp/index.jsp/result
/action

action name=check class=pl.org.lenart.s2demo.IndexAction
method=doCheck
result/jsp/index.jsp/result
/action

/package

index.jsp to test session value

html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en lang=en
head
titleIndex/title
s:head /
/head
body
s:property value=#session.key/
/body
/html


Go to http://localhost:8080/context/index.action and you will see
the value from session, then go to
http://localhost:8080/context/check.action and once again you will
see the same value. Go to some other page in Internet and then come
back to http://localhost:8080/context/check.action, once again you
will see the same ;-)

Your action is free from hard coded dependency to ActionContext. I
check this and it's working, I'm using Struts 2.1.3-SNAPSHOT


Regards
--
Lukasz
http://www.lenart.org.pl/

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



Re: Custom interceptor not firing

2008-06-10 Thread Lukasz Lenart
Hi,

2008/6/10 Gamble, Wesley (WG10) [EMAIL PROTECTED]:

 As far as I can tell from looking at _Struts 2 in Action_, I constructed
 my class correctly.  It is named CompanyIdentificationInterceptor.


The name is not important, did you implement
com.opensymphony.xwork2.interceptor.Interceptor interface or extend
com.opensymphony.xwork2.interceptor.AbstractInterceptor?


Regards
-- 
Lukasz
http://www.lenart.org.pl/


Re: How to set session data based on request parameters and how to retrieve session values correctly via OGNL

2008-06-10 Thread Lukasz Lenart
Hello!

2008/6/10 Gamble, Wesley (WG10) [EMAIL PROTECTED]:

 1) I would like to set some session key-value pairs in response to a
 request parameter so that I can count on these session variables
 throughtout my application.  Should I use an interceptor for this?   How
 does the interceptor get access to the request variables?


Your action class has to implement SessionAware interface and simply add
your key-value to Map provided by setSession(Map session), that's all, no
magic ;-)


 2) Assuming that I have correctly set my session values, how do I
 correctly use them in a JSP.


s:property value=#session.yourKey/


Regards
-- 
Lukasz
http://www.lenart.org.pl/


Re: How to set session data based on request parameters and how to retrieve session values correctly via OGNL

2008-06-10 Thread Lukasz Lenart
2008/6/10 Gamble, Wesley (WG10) [EMAIL PROTECTED]:

 But I want this to happen for every action - and it is dependent on the
 request data that comes in.

Then you should implement Interceptor and investigate
ActionInvocation.getInvocationContext() .getParameters()


Regards
--
Lukasz
http://www.lenart.org.pl/

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



Re: struts editor

2008-06-10 Thread Lukasz Lenart
2008/6/11 Lalchandra Rampersaud [EMAIL PROTECTED]:
 it's not for configuring struts, i just need something visual to design my 
 pages.

As I know, you have to only configure MyEclipse to use Struts2 Tag
Library and then it will be available on component palette, but I
don't remmeber how to do this ;(


Regards
-- 
Lukasz
http://www.lenart.org.pl/

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



Re: How to set session data based on request parameters and how to retrieve session values correctly via OGNL

2008-06-10 Thread Lukasz Lenart
2008/6/10 Gamble, Wesley (WG10) [EMAIL PROTECTED]:
 Should ActionInvocation.getInvocationContext().getParameters() give me a
 Map of request parameters or do I need to pull the HttpServletRequest
 object in another way?

No, just use getParameters() to get raw parameters access


Regards
-- 
Lukasz
http://www.lenart.org.pl/

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



Re: ApplicationAware not triggering setApplication? Or, how best to reference a Connection pool?

2008-06-11 Thread Lukasz Lenart
 My understanding is that the webwork API for ApplicationAware means that the
 interceptor will have it's setApplication(Map applicationData); triggered
 when the interceptor is run, thereby giving me access to the
 applicationcontext.

ApplicationAware should be used with Actions not with interceptors, to
access application just use

public String intercept(ActionInvocation invocation)  {
Map appScope = invocation.getInvocationContext().getApplication();
}


Regards
-- 
Lukasz
http://www.lenart.org.pl/

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



Re: expressions in s:a tag attributes

2008-06-18 Thread Lukasz Lenart
Hi,

Try

s:iterator value=codes
  s:a href=# onmouseover=ddrivetip('%{codeDescription}', 300)
onmouseout=hideddrivetip()
 s:property value=code/
  /s:a
/s:iterator


Regards
-- 
Lukasz
http://www.lenart.org.pl/

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



Re: retriving polish characters from URL Query string

2008-06-18 Thread Lukasz Lenart
Hi,

First of all, isn't possible to encode Polish characters with
ISO-8859-1, you have to use ISO-8859-2 or UTF-8. It's mean, that the
parent web application has to send user_id, name parameters encoded
with ISO-8859-2 or UTF-8. Without that it will be not possible to
decode such strings.


Regards
-- 
Lukasz
http://www.lenart.org.pl/

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



Re: default result name other than SUCCESS?

2008-06-18 Thread Lukasz Lenart
Hi,

2008/6/18 Chris Pratt [EMAIL PROTECTED]:
 I'm not sure if the work-around will work.  Looking at the code, it
 doesn't appear that changing the result type after the action has
 executed has any effect.

Did you already implement it? Could you show the code?
It should be the last interceptor in the stack.

my snippet for intrecept(ActionInvocation invocation)

String result = invocation.invoke();
if (Action.SUCCESS.equals(result)) {
result = LIST;
}
return result;


Regards
-- 
Lukasz
http://www.lenart.org.pl/

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



Re: default result name other than SUCCESS?

2008-06-18 Thread Lukasz Lenart
 The result has already been rendered after invoke() has been called.

Are you sure? I think it wasn't.


Regards
-- 
Lukasz
http://www.lenart.org.pl/

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



Re: Wildcard mappings with subdirectories / folders?

2008-06-18 Thread Lukasz Lenart
Hi,

 Here's my configs - however, the rules are not matching at all - I have my
 JSP's in WEB-INF/jsp/coconut/(blah.jsp) and WEB-INF/jsp/public/(blah.jsp).

action name=coconut/*
interceptor-ref name=mystack /
result 
 name=success/WEB-INF/jsp/coconut/{1}.jsp/result
result 
 name=login/WEB-INF/jsp/coconut/index.jsp/result
/action

action name=public/*
interceptor-ref name=mystack /
result 
 name=success/WEB-INF/jsp/public/{1}.jsp/result
result 
 name=login/WEB-INF/jsp/public/index.jsp/result
/action

You should put your actions to seperate packages with namespaces as you wish

package name=coconut namespace=/coconut extends=struts-default
action name=*
interceptor-ref name=mystack /
result name=success/WEB-INF/jsp/coconut/{1}.jsp/result
 result name=login/WEB-INF/jsp/coconut/index.jsp/result
/action

/package

and the same for second action


Regards
-- 
Lukasz
http://www.lenart.org.pl/

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



Re: default result name other than SUCCESS?

2008-06-18 Thread Lukasz Lenart
 Yes. This is pretty fundamental for interceptors, AFAIK.

 http://struts.apache.org/2.x/docs/writing-interceptors.html

Wow! I've been reading such page many times, but I see such note first
time ;-) Thanks to open my eyes!


Regards
-- 
Lukasz
http://www.lenart.org.pl/

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



Re: simple struts tag to eval OGNL

2008-06-18 Thread Lukasz Lenart
 I didn't know that.
 but actually, I was kind of looking for something that would stay in the
 page. It wouldn't be for debugging, but some simple logic in the page
 for creating the html.

s:debug/ ?


Regards
-- 
Lukasz
http://www.lenart.org.pl/

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



Re: simple struts tag to eval OGNL

2008-06-18 Thread Lukasz Lenart
Hi,

I'm using something like this:

s:radio name=employee.employeeType key=label.employee.type
list=employeeTypes listKey=shortcut
 listValue=name() required=true/

in action I have

public EmployeeType[] getEmployeeTypes() {
return EmployeeType.values();
}

and the enum

public enum EmployeeType
{
DIRECT(D),
INDIRECT(I),
OFFICE(O);

private String shortcut;

EmployeeType(String shortcut) {
this.shortcut = shortcut;
}

public String getShortcut() {
return shortcut;
}

public String toString() {
return EmployeeType{ +
shortcut=' + shortcut + '\'' +
'}';
}
}


Regards
-- 
Lukasz
http://www.lenart.org.pl/

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



Re: simple struts tag to eval OGNL

2008-06-18 Thread Lukasz Lenart
 p.s. to call the static values() method of the enum, 
 struts.ognl.allowStaticMethodAccess must be set to true in struts.properties 
 or struts.xml

Thanks, I've also learned something new ;-)


Regards
-- 
Lukasz
http://www.lenart.org.pl/

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



Re: S2: validation notation on DATE (object that has a Date field)

2008-06-19 Thread Lukasz Lenart
Hi,

Did you try
@RequiredFieldValidator(type = ValidatorType.SIMPLE, fieldName =
customfield, message = You must enter a value for field.)
?


Regards
-- 
Lukasz
http://www.lenart.org.pl/

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



Re: Struts 2 Page Ctrl+R

2008-06-21 Thread Lukasz Lenart
 This worked fine before using Struts 1 and my guess is that it was because
 the form was present in session.

 Is there any way to make this work in Struts 2 ?

You can check Scope Plugin
http://cwiki.apache.org/S2PLUGINS/scope-plugin.html maybe it will be
helpful


Regards
-- 
Lukasz
http://www.lenart.org.pl/

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



Re: [S2] Validator Framework

2008-06-23 Thread Lukasz Lenart
Hi,

Struts2 use XWork Validation Framework, so you can use it
http://www.opensymphony.com/xwork/wikidocs/Validation%20Framework.html


Regards
-- 
Lukasz
http://www.lenart.org.pl/

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



Re: s:submit name attribute problem

2008-06-23 Thread Lukasz Lenart
Hi,

 s:submit name=action action=Submit method=getReport value=Submit/

Just look for source of your page and you will see why. If you want to
use either method or action (not both), maybe it will be better to add
hidden field?


Regards
-- 
Lukasz
http://www.lenart.org.pl/

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



Re: S2: validation notation on DATE (object that has a Date field)

2008-06-23 Thread Lukasz Lenart
 I did, and it doesn't work, when I click submit, I immediately get a red
 message next to the required fields...but not next to the date.

That strange, I made a test and it works, I've annotated at setter level

@RequiredFieldValidator(message = Date is required)
public Date getToday() {
return today;
}

public void setToday(Date today) {
this.today = today;
}


s:textfield label=Today name=today /


Regards
-- 
Lukasz
http://www.lenart.org.pl/

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



  1   2   3   4   5   6   7   8   9   10   >