Re: Pagination

2009-05-25 Thread Lukasz Lenart
2009/5/25 Murugesh :
>   pagesize="10" >
>  
>  
> 

Could you also show action code?


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

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Pagination

2009-05-25 Thread Chris Pratt
You might try:



instead.
  (*Chris*)

On Sun, May 24, 2009 at 11:56 PM, Murugesh  wrote:

> thanks Lukasz
>  what i did is,
>
> added  :displaytag-1.2.jar in the lib
> added  :<%@ taglib uri="http://displaytag.sf.net"; prefix="display"%>  in
> my
> JSP
> code snippet is
>   pagesize="10" >
>  
>  
> 
> thanks
> murugesh
>
> On Mon, May 25, 2009 at 12:15 PM, Lukasz Lenart <
> lukasz.len...@googlemail.com> wrote:
>
> > 2009/5/25 Murugesh :
> > > can any one help me to achieve this?
> >
> > Could you show how did you try to use DisplayTag, some code example?
> >
> >
> > Regards
> > --
> > Lukasz
> > http://www.lenart.org.pl/
> >
> > -
> > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> > For additional commands, e-mail: user-h...@struts.apache.org
> >
> >
>


Re: Pagination

2009-05-25 Thread Murugesh
public class PacketsAction extends ActionBase {
 public ManagePacketsAction() {

   public String call30Mdata() throws ServiceException {
 DataManager dm = new DataManager();
   setMinDataList(dm.getMinsData(null, "getall"))
try {

}


 private List minDataList = null;
 public List getMinDataList() {
return minDataList;
}

public void setMinDataList(List minDataList) {
this.minDataList = minDataList;
}
}


On Mon, May 25, 2009 at 12:35 PM, Lukasz Lenart <
lukasz.len...@googlemail.com> wrote:

> 2009/5/25 Murugesh :
> >   > pagesize="10" >
> >  
> >  
> > 
>
> Could you also show action code?
>
>
> Regards
> --
> Lukasz
> http://www.lenart.org.pl/
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Re: Pagination

2009-05-25 Thread Lukasz Lenart
End the last thing, action's configuration. As I noticed you don't use
execute() method and maybe your are missing call to method
call30Mdata(). And also try Chris suggestion.


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

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Pagination

2009-05-25 Thread Murugesh
No Lukasz

my struts.xml is

/WEB-INF/components/packet/showData.jsp


i am getting list with  but not displaytag

On Mon, May 25, 2009 at 12:53 PM, Lukasz Lenart <
lukasz.len...@googlemail.com> wrote:

> End the last thing, action's configuration. As I noticed you don't use
> execute() method and maybe your are missing call to method
> call30Mdata(). And also try Chris suggestion.
>
>
> Regards
> --
> Lukasz
> http://www.lenart.org.pl/
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Re: Pagination

2009-05-25 Thread Lukasz Lenart
2009/5/25 Murugesh :
> i am getting list with  but not displaytag

Did you try Chris suggestion?


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

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Pagination

2009-05-25 Thread Murugesh
Wow. it getting displayed. but if i click next page it got an error
ie requset resource not available.
is i missed anything?

On Mon, May 25, 2009 at 1:17 PM, Lukasz Lenart  wrote:

> 2009/5/25 Murugesh :
> > i am getting list with  but not displaytag
>
> Did you try Chris suggestion?
>
>
> Regards
> --
> Lukasz
> http://www.lenart.org.pl/
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Re: Pagination

2009-05-25 Thread Murugesh
i got fix for this. i missed request uri in tag.
thanks for helping a lot.

is their any way to modify the display?

like the page no's and no of items coming on top , i need it to be bottom.
so where i have to chnage this?
On Mon, May 25, 2009 at 2:19 PM, Murugesh  wrote:

> Wow. it getting displayed. but if i click next page it got an error
> ie requset resource not available.
> is i missed anything?
>
>   On Mon, May 25, 2009 at 1:17 PM, Lukasz Lenart <
> lukasz.len...@googlemail.com> wrote:
>
>> 2009/5/25 Murugesh :
>> > i am getting list with  but not displaytag
>>
>> Did you try Chris suggestion?
>>
>>
>> Regards
>> --
>> Lukasz
>> http://www.lenart.org.pl/
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>>
>


Re: Pagination

2009-05-25 Thread Lukasz Lenart
2009/5/25 Murugesh :
> is their any way to modify the display?
>
> like the page no's and no of items coming on top , i need it to be bottom.
> so where i have to chnage this?

Check DisplayTag documentation, for begining that [1]

[1] http://displaytag.sourceforge.net/1.2/configuration.html


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

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Keep Action Properties over multiple requests

2009-05-25 Thread Richard Sayre
I have an action that does some server side logic, based on that logic
I want to present the user with a Yes/No message.  If they click yes I
want to save the data the user filled out before the Yes/No message.

Is it possible to carry action properties over multiple requests?  I
found the ScopeInterceptor but I am unsure if that is what I need to
use.

Thanks

Rich

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Keep Action Properties over multiple requests

2009-05-25 Thread Nils-Helge Garli Hegvik
Yes, the ScopeInterceptor should be able to handle this case.

Nils-H

On Mon, May 25, 2009 at 1:02 PM, Richard Sayre  wrote:
> I have an action that does some server side logic, based on that logic
> I want to present the user with a Yes/No message.  If they click yes I
> want to save the data the user filled out before the Yes/No message.
>
> Is it possible to carry action properties over multiple requests?  I
> found the ScopeInterceptor but I am unsure if that is what I need to
> use.
>
> Thanks
>
> Rich
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Pagination

2009-05-25 Thread Bhaarat Sharma
adding to this question...

I've asked this before as well but not gotten a clearer answer.

What if in the same example as this but when user clicks 'next' you want to
go back and fetch the results again.  Will that be possible with display
tag.  What I mean is that lets say that the list is being populated by a
stored procedure.  Because of  performance, we are only getting 50 items at
a time from the store procedure and displaying 50 on one page.  When user
clicks Next, we want to go back and execute the SP to get the next set of 50
results.

Any hints on how to achieve this with display tags?

On Mon, May 25, 2009 at 5:14 AM, Lukasz Lenart  wrote:

> 2009/5/25 Murugesh :
> > is their any way to modify the display?
> >
> > like the page no's and no of items coming on top , i need it to be
> bottom.
> > so where i have to chnage this?
>
> Check DisplayTag documentation, for begining that [1]
>
> [1] http://displaytag.sourceforge.net/1.2/configuration.html
>
>
> Regards
> --
> Lukasz
> http://www.lenart.org.pl/
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


not able to populate the productID or the productName from the front end jsp.

2009-05-25 Thread Prashant Singh
Hi dear,
 
I have an issue.
 
I have been able to display the all the products on a jsp. Now I need to click 
on one product and execute the action class and and display all the suppliers 
supplying the product.
 
I have not been able to execute the action class as I am not able to populate 
the productID or the productName from the front end jsp. 
Basically I am trying to reach the action class from href link which I am able 
to do but I am not populating the productId and productName.
 
I did  read the docs but did not get any answers. 
 
Please Help.
 
__
I am posting the code. 
 
this is my producthandled.jsp
 

<%@ taglib prefix="s" uri="/struts-tags" %> 

 
 
Product Handled 
<

 link href="" rel="stylesheet" 
type="text/css"/> 
 

 
 



This Page Gives the List of Products handled by Astral 
Pharmaceuticals 



Products Handled 

 
 
 
 
 

 


 
 
__
This is my Showproductsuppliers.java
 
package net.astralpharma;
import com.opensymphony.xwork2.ActionSupport;
import java.sql.*;
import java.util.*;
import net.astralpharma.Productdisplay;
public class Showpdtsuppliers extends ActionSupport
 {
 
 private String productId;
 private String productName;
 List supplierName = new ArrayList();
  
 public String doList()
 {
  suppliers=getSupplierName();
  productName=getProductName();
  productId=getProductId();
  return "populate";
 }
  
 public String execute() throws Exception{
 
  String url = "jdbc:mysql://localhost:3306/";
     String dbname="astraldb";
     String driverName="org.gjt.mm.mysql.Driver";
     String userName="root";
     String password="root";
     Connection con=null;
     PreparedStatement stat =null;

 
     
     try
     {
      Class.forName(driverName);
      System.out.println("Driver Loaded");
   con = 
DriverManager.getConnection("jdbc:mysql://localhost:3306/astraldb","root","root"
 );
   System.out.println("Database is connected");
   System.out.println("Product Id = " + productId);
   System.out.println("Product Name = " + productName);
   String query="Select suppliername from supplier_proddetails where 
productName=?";
      stat = con.prepareStatement(query);
      stat.setString(1, productName);
   System.out.println(stat);
   ResultSet rs = stat.executeQuery();
   System.out.println("rs"+ rs);
   while(rs.next())
   {
System.out.println("inside while");
supplierName.add(new Supplier((rs.getString("supplierName";
System.out.println("item added successfully");
   }
   return "success";
  }
  catch(Exception ex){
  ex.printStackTrace();
  System.out.println("Exception" + ex.getMessage());
  }
  return "error";
  }
  
  public List getSupplierName() {
 return  supplierName;
 }
 public void setSupplierName(List supplierName) {
 this.supplierName = supplierName;
 }
 
 public String getProductId() {
 return productId;
 }
 public void setProductId(String productId) {
 this.productId = productId;
 }
 
 public String getProductName() {
 return productName;
 }
 public void setProductName(String productName) {
 this.productName = productName;
 }
}  

-
this is my Supplier.java


package net.astralpharma;
import com.opensymphony.xwork2.ActionSupport;
import java.sql.*;
import java.util.*;
import net.astralpharma.Productdisplay;
public class Showpdtsuppliers extends ActionSupport
 {
 
 private String productId;
 private String productName;
 List supplierName = new ArrayList();
  
 public String doList()
 {
  suppliers=getSupplierName();
  productName=getProductName();
  productId=getProductId();
  return "populate";
 }
  
 public String execute() throws Exception{
 
  String url = "jdbc:mysql://localhost:3306/";
     String dbname="astraldb";
     String driverName="org.gjt.mm.mysql.Driver";
     String userName="root";
     String password="root";
     Connection con=null;
     PreparedStatement stat =null;
     
     try
     {
      Class.forName(driverName);
      System.out.println("Driver Loaded");
   con = 
DriverManager.getConnection("jdbc:mysql://localhost:3306/astraldb","root","root"
 );
   System.out.println("Database is connected");
   System.out.println("Product Id = " + productId);
   System.out.println("Product Name = " + productName);
   String query="Select suppliername from supplier_proddetails where 
productName=?";
      stat = con.prepareStatement(query);
      stat.setString(1, productName);
   System.out.println(stat);
   ResultSet rs = stat.executeQuery();
   System.out.println("rs"+ rs);
   while(rs.next())
   {
System.out.println("inside while");
supplierName.add(new Supplier((rs.getString("supplierName";
System.out.println("item added successfully");
   }
   return "success";
  }
  catch(Exception ex){
  ex.printStack

Re: not able to populate the productID or the productName from the front end jsp.

2009-05-25 Thread Dave Newton

Prashant Singh wrote:

I have been able to display the all the products on a jsp. Now I need
to click on one product and execute the action class and and display
all the suppliers supplying the product.

I have not been able to execute the action class as I am not able to
populate the productID or the productName from the front end jsp. 
Basically I am trying to reach the action class from href link which

I am able to do but I am not populating the productId and
productName.

I did  read the docs but did not get any answers.

Please Help.


Are the links rendering properly? Are you actually iterating over 
anything? In the code you're iterating over "productName", which to me 
sounds like a single entity.


Looking at your code I'm suspicious--what is this supposed to do?

 public String doList()
 {
  suppliers=getSupplierName();
  productName=getProductName();
  productId=getProductId();
  return "populate";
 }

You're calling a local method to set a local value with itself.

Dave

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: I need to set value in the action class

2009-05-25 Thread Jim Kiley
As a side note to Dave's point, opening a unique database connection within
every execute() method of every action class is an extraordinary waste of
your time, and will make debugging pretty painful.  You'd be much better off
writing a single service object to handle that stuff for you, and call the
service object from your action classes.

On Sun, May 24, 2009 at 9:53 AM, Dave Newton  wrote:

> Prashant Singh wrote:
>
>>   > href="astralpharma/showpdtsupp.action">  > value="productName"/>
>>  
>>
>
> There are a few ways to do it; here's two.
>
> 
>  
>
>  
>
>  
>
>  
>  
>
>  
> 
>
> All of these topics are covered in the Struts 2 documentation, which I'd
> recommend reading before getting too much further into your project. There
> are at least a couple more variations, but this should be enough to get you
> started.
>
> Dave
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


-- 
Jim Kiley
Senior Technical Consultant | Summa
[p] 412.258.3346
http://www.summa-tech.com


RE: Pagination

2009-05-25 Thread Martin Gainty

referencing the documentation lucas provided we can see the number of 
records/page are provided by 
displaytag.properties
(version 1.1)
sort.amount=50

(version 1.2)
pagesize=50

..concerning how to manipulate what you're reading all you have to do is 
replace the InputStream with one from DS ...
package org.displaytag.sample.DisplaySourceServlet
protected final void doGet(HttpServletRequest request, HttpServletResponse 
response) throws ServletException,
IOException
{
String jspFile = request.getRequestURI();
// lastIndexOf(".") can't be null, since the servlet is mapped to 
".source"
jspFile = jspFile.substring(0, jspFile.lastIndexOf(".")); //$NON-NLS-1$
if (jspFile.lastIndexOf("/") != -1) //$NON-NLS-1$
{
jspFile = jspFile.substring(jspFile.lastIndexOf("/") + 1); 
//$NON-NLS-1$
}
// only want to show sample pages, don't play with url!
if (!jspFile.startsWith("example-")) //$NON-NLS-1$
{
throw new ServletException("Invalid file selected: " + jspFile); 
//$NON-NLS-1$
}
String fullName = EXAMPLE_FOLDER + jspFile;

//InputStream inputStream = 
getServletContext().getResourceAsStream(fullName);

//replace the inputStream logic with a stream obtained from configured 
DataSource
//if you are using Oracle you can use oracle.sql.OracleJdbc2SQLInput 
readAsciiStream which returns InputStream

readAsciiStream
 public InputStream readAsciiStream() throws SQLException
(Return the next attribute in the stream as a stream of ASCII characters.
)

JavaDoc available at
http://www.oracle.com/technology/docs/tech/java/sqlj_jdbc/doc_library/javadoc/oracle.sql.OracleJdbc2SQLInput.html#_top_

and simply use that InputStream to read DataSource contents from

anyone else?
Martin 
__ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. 
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung 
fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est 
interdite. Ce message sert à l'information seulement et n'aura pas n'importe 
quel effet légalement obligatoire. Étant donné que les email peuvent facilement 
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité 
pour le contenu fourni.




> Date: Mon, 25 May 2009 08:49:33 -0400
> Subject: Re: Pagination
> From: bhaara...@gmail.com
> To: user@struts.apache.org
> 
> adding to this question...
> 
> I've asked this before as well but not gotten a clearer answer.
> 
> What if in the same example as this but when user clicks 'next' you want to
> go back and fetch the results again.  Will that be possible with display
> tag.  What I mean is that lets say that the list is being populated by a
> stored procedure.  Because of  performance, we are only getting 50 items at
> a time from the store procedure and displaying 50 on one page.  When user
> clicks Next, we want to go back and execute the SP to get the next set of 50
> results.
> 
> Any hints on how to achieve this with display tags?
> 
> On Mon, May 25, 2009 at 5:14 AM, Lukasz Lenart  > wrote:
> 
> > 2009/5/25 Murugesh :
> > > is their any way to modify the display?
> > >
> > > like the page no's and no of items coming on top , i need it to be
> > bottom.
> > > so where i have to chnage this?
> >
> > Check DisplayTag documentation, for begining that [1]
> >
> > [1] http://displaytag.sourceforge.net/1.2/configuration.html
> >
> >
> > Regards
> > --
> > Lukasz
> > http://www.lenart.org.pl/
> >
> > -
> > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> > For additional commands, e-mail: user-h...@struts.apache.org
> >
> >

_
Hotmail® has ever-growing storage! Don’t worry about storage limits.
http://windowslive.com/Tutorial/Hotmail/Storage?ocid=TXT_TAGLM_WL_HM_Tutorial_Storage1_052009

Re: [jira] Resolved: (WW-3139) Date validation - Ubuntu 9.04 - struts 2.0.14

2009-05-25 Thread Simone Buzzi
Someone know a solution for this problem?
How must I set my environment?

 Per favore, considerate l'ambiente prima di stampare questa e-mail


 [ 
https://issues.apache.org/struts/browse/WW-3139?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Musachy Barroso resolved WW-3139.
-

Resolution: Not A Problem

Pleas ask question on the user mailing list. Also see the documentation for 
details on what locale struts uses to parse the date

> Date validation
> ---
>
> Key: WW-3139
> URL: https://issues.apache.org/struts/browse/WW-3139
> Project: Struts 2
>  Issue Type: Bug
>Affects Versions: 2.0.14
> Environment: Ubuntu 9.04 it_IT and Ubuntu 9.04 us_US , tomcat 6
>Reporter: Simone B.
>
> Hi, 
> my application has different behaviour in different system with different 
> locale.
> The validator accept dd/MM/ data in IT system and MM/dd/ under the US 
> one.
> I've set 
> * LOCALE in the launch script /etc/init.d/tomcat6 
> * struts.locale in struts.xml and struts.properties 
>to it_IT without fixing the problem.
> I think it's a possible bug

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


  

RE: RequiredString Validation doesn't work and AbstractValidationActionSupport is missing

2009-05-25 Thread Niklas Johansson

Hello,

Ok, I will resend the information but I skip this hotmail account since it 
corrupts things. My new mail will come from nicss...@gmail.com. 

I close this now. 

Thank you!

Regards,
Niklas

> Date: Sun, 24 May 2009 17:30:26 -0400
> From: newton.d...@yahoo.com
> To: user@struts.apache.org
> Subject: Re: RequiredString Validation doesn't work and 
> AbstractValidationActionSupport is missing
>
> Niklas Johansson wrote:
>> Such a beginner error... But after renaming the validation.xml file
>> to what you specifide, still no error-response when not entering
>> anything in the "heading" field.
>
> You'll have to post your original message but so it's readable--the list
> accepts plain-text emails, most likely you sent yours as HTML.
>
> On a side note, I'm not sure why you're using ParameterAware in your
> Java class--unless you have a compelling reason to use it, it's
> generally cleaner to just use the action properties.
>
>> When extending my action class with AbstractValidationActionSupport
>> as described on Struts' specification:
>> http://struts.apache.org/2.1.6/docs/using-field-validators.html, the
>> application cannot find the actual AbstractValidationActionSupport
>> class. I tried to include all jars in the lib folder of struts, it
>> still cannot find the class.
>
> That class is part of the showcase app, not part of Struts itself.
>
> Dave
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>

_
Invite your mail contacts to join your friends list with Windows Live Spaces. 
It's easy!
http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us
-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



RequiredString Validation doesn't work and AbstractV alidationActionSupport is missing‏

2009-05-25 Thread Niklas Johansson
Hello,

I am trying to create my first validation. I have two problems:

First one:

I want to use Requieredstring validator. The problem is that my
application is not complaining if I do leave the input field empty.

Here is my code:

reqisterqa.jsp:

<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
http://www.w3.org/TR/html4/loose.dtd";>




Insert title here





   









 struts.xml (part of):



/jsp/forms/registerqa.jsp
/jsp/forms/registerqa.jsp
/jsp/forms/registerqa.jsp




RegisterQAForm class:

package org.nicsoft.application.mobiletraining.qa;

import java.io.IOException;
import java.util.Map;
import org.apache.struts2.interceptor.ParameterAware;
import com.opensymphony.xwork2.ActionSupport;

public class RegisterQAFormAction extends ActionSupport implements
ParameterAware  {

public String message;
public String heading;

Map param;

public String execute() throws Exception {

System.out.println(param.get("heading")[0]);
System.out.println(param.get("answer")[0]);
QAHandler handleQA = new QAHandler();
handleQA.storeQA(param);

setMessage("Ärende " + param.get("heading")[0] + "
registrerat");
if (getHeading() != null){
  return SUCCESS;
}
else{
  return ERROR;
}
}

public void setParameters(Map param) {
this.param = param;

}

public void setMessage(String message){
 this.message = message;
}

public String getMessage() {
 return message;
}

public void setHeading(String heading){
this.heading = heading;
}

public String getHeading(){
return this.heading;
}
}


RegisterQAForm-validation.xml:


http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd";>



  

  true
  Heading Name is required

  




I did put the RegisterQAForm-validation.xml in the same package as the
class RegisterQAForm. Also tried to put it in the root/default
package, no difference.

Can anyone tell me what is the problem?

Since I moved this mail-conversation from another mail that corrupted
the mail, I include some questions from the old conversation here
posted by Dave:

Q: "why you're using ParameterAware" ... "it's generally cleaner to
just use the action properties"

A: The reason is because I found the instructions on the struts
homepage. Using the action properties, I assume I need to define those
in the struts.xml, correct?


My second problem:

I also want to use the Field Validator at some point. But it's some
problem with the AbstractValidationActionSupport class. It isn't
found. Anyone knows where this class is located? Couldn't find it in
XWork where I though it's supposed to be.

Q: "That class is part of the showcase app, not part of Struts itself."

A: So what is the solution? The instructions wasn't that clear about
where the class came from on the instruction page:
http://struts.apache.org/2.1.6/docs/using-field-validators.html

Thank you in advance!

Regards,
Niklas

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Pagination

2009-05-25 Thread Chris Pratt
Yup, it's possible, just read the DisplayTag documentation on external
pagination.
  (*Chris*)

On Mon, May 25, 2009 at 5:49 AM, Bhaarat Sharma  wrote:

> adding to this question...
>
> I've asked this before as well but not gotten a clearer answer.
>
> What if in the same example as this but when user clicks 'next' you want to
> go back and fetch the results again.  Will that be possible with display
> tag.  What I mean is that lets say that the list is being populated by a
> stored procedure.  Because of  performance, we are only getting 50 items at
> a time from the store procedure and displaying 50 on one page.  When user
> clicks Next, we want to go back and execute the SP to get the next set of
> 50
> results.
>
> Any hints on how to achieve this with display tags?
>
> On Mon, May 25, 2009 at 5:14 AM, Lukasz Lenart <
> lukasz.len...@googlemail.com
> > wrote:
>
> > 2009/5/25 Murugesh :
> > > is their any way to modify the display?
> > >
> > > like the page no's and no of items coming on top , i need it to be
> > bottom.
> > > so where i have to chnage this?
> >
> > Check DisplayTag documentation, for begining that [1]
> >
> > [1] http://displaytag.sourceforge.net/1.2/configuration.html
> >
> >
> > Regards
> > --
> > Lukasz
> > http://www.lenart.org.pl/
> >
> > -
> > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> > For additional commands, e-mail: user-h...@struts.apache.org
> >
> >
>


Re: RequiredString Validation doesn't work and AbstractValidationActionSupport is missing?

2009-05-25 Thread Dave Newton

Niklas Johansson wrote:

I want to use Requieredstring validator. The problem is that my
application is not complaining if I do leave the input field empty.


Are you using the default interceptor stack?


Can anyone tell me what is the problem?


I don't see anything immediately obvious, but I'm sleepy.


Q: "why you're using ParameterAware" ... "it's generally cleaner to
just use the action properties"

A: The reason is because I found the instructions on the struts
homepage. Using the action properties, I assume I need to define those
in the struts.xml, correct?


Define what in the struts.xml? The "struts homepage" doesn't have 
instructions for doing *anything*, so you'll have to be more specific as 
to what you were reading so we can correct it.


The probable answer to your question is "no". One of the main features 
(IMO) of S2 is that it eliminates a lot of back-and-forth between HTML 
forms and actions, meaning your code could be written follows, getters 
and setters elided. (And why make the action properties public if you 
have getters/setters for them?)


public class RegisterQAFormAction extends ActionSupport {

private String message;
private String heading;

public String execute() throws Exception {
System.out.println(heading);
System.out.println(answer);

// Don't know what this is trying to do, so ignoring.
//QAHandler handleQA = new QAHandler();
//handleQA.storeQA(param);

setMessage("Ärende " + heading + " registrerat");
if (getHeading() == null) {
return ERROR;
}

return SUCCESS;
}

}

Note that heading won't be null if the user doesn't enter a value--it 
will be an empty string, so in all probability this is a bug in your code.



Q: "That class is part of the showcase app, not part of Struts itself."

A: So what is the solution? The instructions wasn't that clear about
where the class came from on the instruction page:
http://struts.apache.org/2.1.6/docs/using-field-validators.html


Solution to what problem? You don't need that class to use the 
validation as you've written it above.


Dave

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org