Re: How to access a map in jsp

2015-08-27 Thread Yaragalla Muralidhar
i have added methods to get the primitive integers as strings in dto. that
solved my problem. thanks Christoph.

*Thanks and Regards,*
Muralidhar Yaragalla.

*http://yaragalla.blogspot.in/ <http://yaragalla.blogspot.in/>*

On Thu, Aug 27, 2015 at 2:56 PM, Christoph Nenning <
christoph.nenn...@lex-com.net> wrote:

> What are the types of antibioticId and organismTypeId ?
> Are they primitive integers/longs?
> I would add methods to DTOs to get them as Strings.
>
>
> I suggest to store the list in a pageScope variable, to make the
> expression better readable.
> There should be no dot before the bracket. You wrote "oaMap.[", it should
> be "oaMap["
>
>
>
> 
> 
>
>
>
>
>
> Regards,
> Christoph
>
>
>
>
>
>
> Yaragalla Muralidhar  schrieb am 27.08.2015
> 11:17:06:
>
> > From: Yaragalla Muralidhar 
> > To: Struts Users Mailing List ,
> > Date: 27.08.2015 11:17
> > Subject: How to access a map in jsp
> >
> > Hi,
> >  the following is the code in action class
> >
> > //_
> > private List antibiotics;
> > private List organismTypes;
> > private Map> oaMap;
> > @Override
> > public String execute() throws Exception {
> > try{
> > antibiotics=dtService.getAllAntibioticsList();
> > organismTypes=dtService.getAllOrganisumTypes();
> > oaMap=dtService.getAllSelectedOrganismTypeAntibiotics();
> > }catch(Exception e){
> > log.error(e.getMessage(), e);
> > return "error";
> > }
> > return SUCCESS;
> > }
> > //_
> >
> > The following is the code in jsp
> >
> > 
> > 
> > 
> >  test="%{oaMap.[((new
> > Integer(antibioticId).toString()))].contains((new
> > Integer(organismTypeId).toString()))}">checked value=' > value="antibioticId"/>' style="line-height: 35px;" />
> > 
> > 
> > 
> >
> > //__
> >
> > i am trying to get the arrylist from the map and trying to check whether
> it
> > contains a particular string but this is not working? is this the right
> way
> > to do this? If not how to do this?
> >
> > *Thanks and Regards,*
> > Muralidhar Yaragalla.
> >
> > *http://yaragalla.blogspot.in/ <http://yaragalla.blogspot.in/>*
>
> This Email was scanned by Sophos Anti Virus
>


Re: How to access a map in jsp

2015-08-27 Thread Christoph Nenning
What are the types of antibioticId and organismTypeId ?
Are they primitive integers/longs?
I would add methods to DTOs to get them as Strings.


I suggest to store the list in a pageScope variable, to make the 
expression better readable.
There should be no dot before the bracket. You wrote "oaMap.[", it should 
be "oaMap["










Regards,
Christoph






Yaragalla Muralidhar  schrieb am 27.08.2015 
11:17:06:

> From: Yaragalla Muralidhar 
> To: Struts Users Mailing List , 
> Date: 27.08.2015 11:17
> Subject: How to access a map in jsp
> 
> Hi,
>  the following is the code in action class
> 
> //_
> private List antibiotics;
> private List organismTypes;
> private Map> oaMap;
> @Override
> public String execute() throws Exception {
> try{
> antibiotics=dtService.getAllAntibioticsList();
> organismTypes=dtService.getAllOrganisumTypes();
> oaMap=dtService.getAllSelectedOrganismTypeAntibiotics();
> }catch(Exception e){
> log.error(e.getMessage(), e);
> return "error";
> }
> return SUCCESS;
> }
> //_
> 
> The following is the code in jsp
> 
> 
> 
> 
> checked value=' value="antibioticId"/>' style="line-height: 35px;" />
> 
> 
> 
> 
> //__
> 
> i am trying to get the arrylist from the map and trying to check whether 
it
> contains a particular string but this is not working? is this the right 
way
> to do this? If not how to do this?
> 
> *Thanks and Regards,*
> Muralidhar Yaragalla.
> 
> *http://yaragalla.blogspot.in/ <http://yaragalla.blogspot.in/>*

This Email was scanned by Sophos Anti Virus


How to access a map in jsp

2015-08-27 Thread Yaragalla Muralidhar
Hi,
 the following is the code in action class

//_
private List antibiotics;
private List organismTypes;
private Map> oaMap;
@Override
public String execute() throws Exception {
try{
antibiotics=dtService.getAllAntibioticsList();
organismTypes=dtService.getAllOrganisumTypes();
oaMap=dtService.getAllSelectedOrganismTypeAntibiotics();
}catch(Exception e){
log.error(e.getMessage(), e);
return "error";
}
return SUCCESS;
}
//_

The following is the code in jsp




checked  value='' style="line-height: 35px;" />




//__

i am trying to get the arrylist from the map and trying to check whether it
contains a particular string but this is not working? is this the right way
to do this? If not how to do this?

*Thanks and Regards,*
Muralidhar Yaragalla.

*http://yaragalla.blogspot.in/ <http://yaragalla.blogspot.in/>*


Re: replace Java scriptlets in JSP page

2014-12-30 Thread Christoph Nenning
> 
> I am using struts 1 because of company policy.
> 
> 

With struts1 you can use JSTL EL, too. The form bean names are available 
in EL. And struts1 has it's own tag lib.



regards,
Christoph

This Email was scanned by Sophos Anti Virus


Re: replace Java scriptlets in JSP page

2014-12-30 Thread Albert Kao
I am using struts 1 because of company policy.
 

 On Monday, December 29, 2014 11:20 PM, Sreekanth S. Nair 
 wrote:
   

 Sure you can, please if you are using struts2 please read these tutorials
Struts2 Tag lesson
http://www.tutorialspoint.com/struts_2/
or
http://struts.apache.org/docs/tag-reference.html

and a bit of JSP EL
http://www.tutorialspoint.com/jsp/jsp_expression_language.htm




-- 
Thanks & Regards

Sreekanth S Nair
Java Developer
---
eGovernments Foundation 
Ph : 9980078913
---

  

---

On Tue, Dec 30, 2014 at 4:47 AM, Albert Kao  wrote:

> The following Java scriptlet code in a Struts jsp is working fine.
> However, is it possible to change the jsp code so as to remove all
> the Java scriptlet codes?
>
> The .jsp code is like this:<%
>  HttpSession httpSession = request.getSession(true);
>  MyClient myClient =
> (MyClient)httpSession.getAttribute(MyConst.MY_CLIENT);
> %>
>   property="pOwners" length="<%=MyConst.MY_OWNER_MAX%>" indexId="index">
>  <%
>    pageContext.setAttribute("requiredIndex",
> myClient.getRequiredIndex(index), PageContext.PAGE_SCOPE);
>  %>
>  
>     <%=
> myClient.getNumber(index) %>
>  
>
>  
>    
>      
>        
>        
>      
>    
>    
>      ">
>        
>      
>    
>          styleId='<%="lastName" + index%>' name="inputForm"
>      property='<%="myForm.pOwners["+index+"].lastName"%>' size="62"
>      maxlength="30" />
>  
> 
>
>
> The java code is like this:public class Owner implements
> java.io.Serializable {
>    private static final long serialVersionUID = 7920764268572909394L;
>    private String lastName;
>    private String ownershipCode;
>    //...
>
>    public Owner() {
>    }
>
>    // getter and setters
>    public String getLastName() {
>        return lastName;
>    }
>
>    public void setLastName(String lastName) {
>        this.lastName = lastName;
>    }
>
>    //...
>    public Integer getRequiredIndex(Integer index) {
>        Integer requiredIndex = index;
>        if (OWNRSHP_PARTNER.equals(ownershipCode)) {
>            requiredIndex = requiredIndex - 1;
>        }
>        return requiredIndex;
>    }
>
>    public String getNumber(Integer index) {
>        String number = Integer.toString(index + 1);
>        if (OWNRSHP_SOLE.equals(ownershipCode)) {
>            number = "";
>        }
>        return number;
>    }
> }
>
>


   

Re: replace Java scriptlets in JSP page

2014-12-29 Thread Sreekanth S. Nair
Sure you can, please if you are using struts2 please read these tutorials
Struts2 Tag lesson
http://www.tutorialspoint.com/struts_2/
or
http://struts.apache.org/docs/tag-reference.html

and a bit of JSP EL
http://www.tutorialspoint.com/jsp/jsp_expression_language.htm




-- 
Thanks & Regards

Sreekanth S Nair
Java Developer
---
eGovernments Foundation 
Ph : 9980078913
---

   

---

On Tue, Dec 30, 2014 at 4:47 AM, Albert Kao  wrote:

> The following Java scriptlet code in a Struts jsp is working fine.
> However, is it possible to change the jsp code so as to remove all
> the Java scriptlet codes?
>
> The .jsp code is like this:<%
>   HttpSession httpSession = request.getSession(true);
>   MyClient myClient =
> (MyClient)httpSession.getAttribute(MyConst.MY_CLIENT);
> %>
>property="pOwners" length="<%=MyConst.MY_OWNER_MAX%>" indexId="index">
>   <%
> pageContext.setAttribute("requiredIndex",
> myClient.getRequiredIndex(index), PageContext.PAGE_SCOPE);
>   %>
>   
>  <%=
> myClient.getNumber(index) %>
>   
>
>   
> 
>   
> 
> 
>   
> 
> 
>   ">
> 
>   
> 
>styleId='<%="lastName" + index%>' name="inputForm"
>   property='<%="myForm.pOwners["+index+"].lastName"%>' size="62"
>   maxlength="30" />
>   
> 
>
>
> The java code is like this:public class Owner implements
> java.io.Serializable {
> private static final long serialVersionUID = 7920764268572909394L;
> private String lastName;
> private String ownershipCode;
> //...
>
> public Owner() {
> }
>
> // getter and setters
> public String getLastName() {
> return lastName;
> }
>
> public void setLastName(String lastName) {
> this.lastName = lastName;
> }
>
> //...
> public Integer getRequiredIndex(Integer index) {
> Integer requiredIndex = index;
> if (OWNRSHP_PARTNER.equals(ownershipCode)) {
> requiredIndex = requiredIndex - 1;
> }
> return requiredIndex;
> }
>
> public String getNumber(Integer index) {
> String number = Integer.toString(index + 1);
> if (OWNRSHP_SOLE.equals(ownershipCode)) {
> number = "";
> }
> return number;
> }
> }
>
>


replace Java scriptlets in JSP page

2014-12-29 Thread Albert Kao
The following Java scriptlet code in a Struts jsp is working fine. 
However, is it possible to change the jsp code so as to remove all the Java 
scriptlet codes? 

The .jsp code is like this:<%
  HttpSession httpSession = request.getSession(true);
  MyClient myClient = (MyClient)httpSession.getAttribute(MyConst.MY_CLIENT);
%>

  <%
    pageContext.setAttribute("requiredIndex", myClient.getRequiredIndex(index), 
PageContext.PAGE_SCOPE);
  %>
  
     <%= myClient.getNumber(index) %>
  

  
    
  
    
    
  
    
    
  ">
    
  
    
    
  



The java code is like this:public class Owner implements java.io.Serializable {
    private static final long serialVersionUID = 7920764268572909394L;
    private String lastName;
    private String ownershipCode;
    //...
    
    public Owner() {
    }

    // getter and setters
    public String getLastName() {
        return lastName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    //...
    public Integer getRequiredIndex(Integer index) {
        Integer requiredIndex = index;
        if (OWNRSHP_PARTNER.equals(ownershipCode)) {
            requiredIndex = requiredIndex - 1;
        }
        return requiredIndex;    
    }

    public String getNumber(Integer index) {
        String number = Integer.toString(index + 1);
        if (OWNRSHP_SOLE.equals(ownershipCode)) {
            number = "";
        } 
        return number;    
    }
}



Re: put ArrayList to s:hidden in jsp?

2012-10-18 Thread vEnkaTa mohAna rAo SriperumbUdUru
Use session object.

On Thu, Oct 18, 2012 at 8:56 PM,  wrote:

> You can not do this directly as hidden field is used to store only a value
>
> You need indexed field to store those value
>
> I am not sure why you want to do this as more information can help others
> to provide some solutions
> --Original Message--
> From: Emi Lu
> To: user@struts.apache.org
> ReplyTo: Struts Users Mailing List
> ReplyTo: em...@encs.concordia.ca
> Subject: put ArrayList to s:hidden in jsp?
> Sent: Oct 18, 2012 7:45 PM
>
> Good morning,
>
> Is there a way to put hidden ArrayList in JSP please?
>
> For example in a.jsp:
>
> 
>
> In action java class:
> private ArrayListarraylist1 ;
>
> So that abean.arraylist1 could be retrieved by action java class.
>
> Thanks a lot!
> Emi
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>
>
> Sent from BlackBerry® on Airtel


Re: put ArrayList to s:hidden in jsp?

2012-10-18 Thread umeshawasthi
You can not do this directly as hidden field is used to store only a value

You need indexed field to store those value

I am not sure why you want to do this as more information can help others to 
provide some solutions
--Original Message--
From: Emi Lu
To: user@struts.apache.org
ReplyTo: Struts Users Mailing List
ReplyTo: em...@encs.concordia.ca
Subject: put ArrayList to s:hidden in jsp?
Sent: Oct 18, 2012 7:45 PM

Good morning,

Is there a way to put hidden ArrayList in JSP please?

For example in a.jsp:



In action java class:
private ArrayListarraylist1 ;

So that abean.arraylist1 could be retrieved by action java class.

Thanks a lot!
Emi

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



Sent from BlackBerry® on Airtel

put ArrayList to s:hidden in jsp?

2012-10-18 Thread Emi Lu

Good morning,

Is there a way to put hidden ArrayList in JSP please?

For example in a.jsp:



In action java class:
private ArrayListarraylist1 ;

So that abean.arraylist1 could be retrieved by action java class.

Thanks a lot!
Emi

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



put ArrayList to s:hidden in jsp?

2012-10-18 Thread Emi Lu

Good morning,

Is there a way to put hidden ArrayList in JSP please?

For example in a.jsp:



In action java class:
private ArrayListarraylist1 ;

So that abean.arraylist1 could be retrieved by action java class.

Thanks a lot!
Emi



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



Re: additional params for tags in JSP

2012-10-14 Thread Lukasz Lenart
2012/10/13 J. Garcia :
> Hi,
> If I want to have an additinal attribute, say, in a textfield tag, in a
> JSP, and use it in the freemarker template for the corresponding tag,
> text.ftl:
>
> - can it be done without extending the tag library?
> - how are the additional attributes passed in the JSP?
> - how are they retrieved in the corresponding freemarker template?

Dynamic Attributes ? I cannot find more info, just this [1] but I'm
sure there were more (I wrote something about that)

[1] http://struts.apache.org/2.x/docs/freemarker-tags.html


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

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



additional params for tags in JSP

2012-10-13 Thread J. Garcia
Hi,
If I want to have an additinal attribute, say, in a textfield tag, in a
JSP, and use it in the freemarker template for the corresponding tag,
text.ftl:

- can it be done without extending the tag library?
- how are the additional attributes passed in the JSP?
- how are they retrieved in the corresponding freemarker template?

Cheers,
J. Garcia


RE: In Struts 1.3 how to display multiple images in jsp from database

2012-04-24 Thread Givler, Eric
You should just Google things like this.  I did a quick search on: img tag to 
display image from database jsp

Here was the first link which explains it pretty well.
http://www.coderanch.com/t/292437/JSP/java/display-image-after-retrieving-it

Sorry for the late response.

Eric

-Original Message-
From: raaja.g [mailto:raaj...@gmail.com] 
Sent: Wednesday, March 21, 2012 2:14 AM
To: user@struts.apache.org
Subject: In Struts 1.3 how to display multiple images in jsp from database

Hi, 

I am facing problem in displaying multiple images at a time in jsp. I am
able to retrieve the images from db and storing them in a list and
forwarding that to jsp in request from Action class. But I am not able to
display those images in jsp. I am not getting an idea how to render those
images which are in the List collection. I am using struts 1.3. 

If any one have idea please guide me. 

Thanking you

--
View this message in context: 
http://struts.1045723.n5.nabble.com/In-Struts-1-3-how-to-display-multiple-images-in-jsp-from-database-tp5582018p5582018.html
Sent from the Struts - User mailing list archive at Nabble.com.

-
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



In Struts 1.3 how to display multiple images in jsp from database

2012-03-20 Thread raaja.g
Hi, 

I am facing problem in displaying multiple images at a time in jsp. I am
able to retrieve the images from db and storing them in a list and
forwarding that to jsp in request from Action class. But I am not able to
display those images in jsp. I am not getting an idea how to render those
images which are in the List collection. I am using struts 1.3. 

If any one have idea please guide me. 

Thanking you

--
View this message in context: 
http://struts.1045723.n5.nabble.com/In-Struts-1-3-how-to-display-multiple-images-in-jsp-from-database-tp5582018p5582018.html
Sent from the Struts - User mailing list archive at Nabble.com.

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



Re: Struts2 resource property and dynamic population of action in jsp file

2011-05-27 Thread Sachin Lale

Thanks Dave.
I am using Struts 2.2.3. For #2 question i have a common jsp which is 
used for both Add and Edit operation. So on the basis of whether it is 
add/edit i want to set appropriate action.
Well one tweak just now came in my mind is to set the action name in 
request scope and use this as OGNL in setting form action.


Best regards,
Sachin

On 27-05-2011 20:30, Dave Newton wrote:

On Fri, May 27, 2011 at 10:40 AM, Sachin Lale wrote:

1. In Jsp while displaying text box and i want this to populate from
ApplicationResource.properties file. I did this be adding getText() method
like below. Is this the only way?


Nope; you can use the "key" tag attribute to define the property name
and label key at once.

JSP:
Resource: name=Full Name


2. I want the 'action' property of s:form tag to be populated dynamically.
For this i added a instance variable in my action 'onsubmitAction' and
setting this value before action forward to result.
  or. But
this is not working. Is there any way for this use case.

Not sure; I might consider doing this a different way, though, perhaps
through a custom JSP-based tag (possibly a thin layer over an existing
tag).

(Why that way? I find it more informative, and it allows some
interesting games to be played.)

In any case, which version of S2 are you using?

Dave

-
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: Struts2 resource property and dynamic population of action in jsp file

2011-05-27 Thread Dave Newton
On Fri, May 27, 2011 at 10:40 AM, Sachin Lale wrote:
> 1. In Jsp while displaying text box and i want this to populate from
> ApplicationResource.properties file. I did this be adding getText() method
> like below. Is this the only way?
> 

Nope; you can use the "key" tag attribute to define the property name
and label key at once.

JSP: 
Resource: name=Full Name

> 2. I want the 'action' property of s:form tag to be populated dynamically.
> For this i added a instance variable in my action 'onsubmitAction' and
> setting this value before action forward to result.
>  or . But
> this is not working. Is there any way for this use case.

Not sure; I might consider doing this a different way, though, perhaps
through a custom JSP-based tag (possibly a thin layer over an existing
tag).

(Why that way? I find it more informative, and it allows some
interesting games to be played.)

In any case, which version of S2 are you using?

Dave

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



Struts2 resource property and dynamic population of action in jsp file

2011-05-27 Thread Sachin Lale

  Hi,
I have two questions:
1. In Jsp while displaying text box and i want this to populate from 
ApplicationResource.properties file. I did this be adding getText() 
method like below. Is this the only way?



2. I want the 'action' property of s:form tag to be populated 
dynamically. For this i added a instance variable in my action 
'onsubmitAction' and setting this value before action forward to result.
 or . 
But this is not working. Is there any way for this use case.


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



RE: Velocity Inclusion in JSP

2011-04-15 Thread Biesbrock, Kevin
From: Dave Newton [mailto:davelnew...@gmail.com] 
> Do the templates use the same models as the web layer?

Actually, it would have been good to note that the contact information
is hard-coded.  So there is no need for a model.  I literally just need
to include a block of html-/css-formatted text.

Beez


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



Re: Velocity Inclusion in JSP

2011-04-15 Thread Dave Newton
On Fri, Apr 15, 2011 at 1:03 PM, Biesbrock, Kevin wrote:
> So I have a block of contact information that we would like to appear 
> similarly whenever it's displayed.  So on our home page, on a printable 
> confirmation page, or in a generated email -- it should always appear the 
> same.  Yesterday I emailed this group about this a little bit (and forgot to 
> mention the context in this email), titled: 'Reading .properties From 
> Top-Level Package'.  Eric Lents suggested:
>
>> E-mail and Velocity are like peanut butter and jelly.
>
> So I found documentation on how to compile a Velocity template in a java 
> class but cannot find anything that would show my e.g. contact block on the 
> homepage.  So I thought *maybe* the best approach would be to use an s:action 
> tag that returned a Velocity result of the template I requested.
>
> In terms of my email, I can use Velocity to generate the email with no 
> problem -- and can even include, toward the bottom, the contact block.
>
> Does that help identify my use-case a little more clearly?

Yep.

Do the templates use the same models as the web layer? If so, seems
like direct rendering would be *much* more efficient.

Dave

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



Re: Velocity Inclusion in JSP

2011-04-15 Thread Dave Newton
Seems like a JSP-based custom tag would be the easiest, but I don't
actually know what your template requirements are, so it's tough to
say.

What's the use-case?

Dave

On Fri, Apr 15, 2011 at 11:13 AM, Biesbrock, Kevin
 wrote:
> There seem to be plenty of documents outlining how to include a jsp in a
> velocity template, but not the other way around.  I am having a
> difficult time finding information on how to include a Velocity template
> in a JSP.  I recognized the s:component tag could work, but my templates
> are not currently in my template (or "theme") folder and I feel like
> they don't belong there because they are specific to my app, not the
> chosen theme.  I don't have enough time with the schedule of our
> application to go back and convert all of the JSPs to Velocity
> templates.
>
> So one solution I thought of would be to create an action that returns
> the Velocity result...but I don't really know how I feel about this
> approach:
> 
> /WEB-INF/myVelocityTemplates/{1}.vm
> 
>
> I would appreciate any guidance on this.
>
> d[-_-]b \m/
> Beez
>
>
> -
> 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



Velocity Inclusion in JSP

2011-04-15 Thread Biesbrock, Kevin
There seem to be plenty of documents outlining how to include a jsp in a
velocity template, but not the other way around.  I am having a
difficult time finding information on how to include a Velocity template
in a JSP.  I recognized the s:component tag could work, but my templates
are not currently in my template (or "theme") folder and I feel like
they don't belong there because they are specific to my app, not the
chosen theme.  I don't have enough time with the schedule of our
application to go back and convert all of the JSPs to Velocity
templates.
 
So one solution I thought of would be to create an action that returns
the Velocity result...but I don't really know how I feel about this
approach:

/WEB-INF/myVelocityTemplates/{1}.vm

 
I would appreciate any guidance on this.
 
d[-_-]b \m/
Beez


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



How to embed jasper report in jsp page using struts2-jasperreports-plugin

2011-03-25 Thread Sewwandi
Hi

I'm creating a report using jasper report and successfully generated the
report with struts2-jasperreports-plugin, in my web application.
the report is displayed in html format, now i need to embed this report in a
jsp page, but couldn't find a way to do that. Could some one please help me
to achieve this task?
following is the struts configuration i have used:



jasper\report4.jasper
myList
HTML
/servlets/image?image=



Thanks in advance...!


Re: retaining the values in html:select multiple="true" in jsp + collection + struts

2011-01-12 Thread Dave Newton
No; you'd need to re-load the contents/selections either in page load,
like normal, or on document ready via Ajax.

Dvae

On Wednesday, January 12, 2011,   wrote:
> Maurizio,
>
>         Thanks a lot it worked for all the fields except few lists which has
> a call to AjaxServlet in it.  Can you help me with this?
>
> -Original Message-
> From: Maurizio Cucchiara [mailto:maurizio.cucchi...@gmail.com]
> Sent: Wednesday, January 12, 2011 3:06 PM
> To: Struts Users Mailing List
> Subject: Re: retaining the values in html:select multiple="true" in jsp +
> collection + struts
>
> Here it the mail content:
>
> Just to confirm,  I dont need to place the following
>
>   
>   
>   
>
> In my pages? It is cool not to see these repeated lines
> in all my pages
>
> -Dan
>
>
>
> 2011/1/12  :
>> Lukasz,
>>
>>    Yes, I am using Struts 1.3.8.  I don't think Interceptor is supported
> in
>> it.  I tried the link you shared, but still it is not working.  Could you
>> please share me the right example to fix this ?
>>
>> Best Regards,
>> Vikram
>> -Original Message-
>> From: Maurizio Cucchiara [mailto:maurizio.cucchi...@gmail.com]
>> Sent: Wednesday, January 12, 2011 2:13 PM
>> To: Struts Users Mailing List; lukasz.len...@gmail.com
>> Subject: Re: retaining the values in html:select multiple="true" in jsp +
>> collection + struts
>>
>> Lukasz,
>> I'm afraid he is using struts 1.
>> Anyway, I think that when user goes back using the browser's arrow,
>> the page is loaded from cache. So It shouldn't be a  matter of Struts.
>>
>> My suggest is that you should find a way to avoid http caching [1] (I
>> don't know if it works, I usually use header-based approach).
>>
>>
> http://mail-archives.apache.org/mod_mbox/struts-user/200307.mbox/%3CLaw11-OE
>> 35m2gymxwmf00059...@hotmail.com%3e
>>
>>
>>
>> 2011/1/12 Lukasz Lenart :
>>> 2011/1/12 
>>>> Could some one help me on this please with some example?
>>>
>>> Please read a bit about Preparable interface
>>>
>>
> http://struts.apache.org/2.x/struts2-core/apidocs/com/opensymphony/xwork2/Pr
>> eparable.html
>>> http://struts.apache.org/2.2.1.1/docs/prepare-interceptor.html
>>>
>>>
>>> Regards
>>> --
>>> Łukasz
>>> + 48 606 323 122 http://www.lenart.org.pl/
>>> Kapituła Javarsovia http://javarsovia.pl
>>>
>>> -
>>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>>> For additional commands, e-mail: user-h...@struts.apache.org
>>>
>>>
>>
>>
>>
>> --
>> Maurizio Cucchiara
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>>
>>
>
>
>
> --
> Maurizio Cucchiara
>
> -
> 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: retaining the values in html:select multiple="true" in jsp + collection + struts

2011-01-12 Thread vikram.g.byali
Maurizio,

Thanks a lot it worked for all the fields except few lists which has
a call to AjaxServlet in it.  Can you help me with this? 

-Original Message-
From: Maurizio Cucchiara [mailto:maurizio.cucchi...@gmail.com] 
Sent: Wednesday, January 12, 2011 3:06 PM
To: Struts Users Mailing List
Subject: Re: retaining the values in html:select multiple="true" in jsp +
collection + struts

Here it the mail content:

Just to confirm,  I dont need to place the following

  
  
  

In my pages? It is cool not to see these repeated lines
in all my pages

-Dan



2011/1/12  :
> Lukasz,
>
>    Yes, I am using Struts 1.3.8.  I don't think Interceptor is supported
in
> it.  I tried the link you shared, but still it is not working.  Could you
> please share me the right example to fix this ?
>
> Best Regards,
> Vikram
> -Original Message-
> From: Maurizio Cucchiara [mailto:maurizio.cucchi...@gmail.com]
> Sent: Wednesday, January 12, 2011 2:13 PM
> To: Struts Users Mailing List; lukasz.len...@gmail.com
> Subject: Re: retaining the values in html:select multiple="true" in jsp +
> collection + struts
>
> Lukasz,
> I'm afraid he is using struts 1.
> Anyway, I think that when user goes back using the browser's arrow,
> the page is loaded from cache. So It shouldn't be a  matter of Struts.
>
> My suggest is that you should find a way to avoid http caching [1] (I
> don't know if it works, I usually use header-based approach).
>
>
http://mail-archives.apache.org/mod_mbox/struts-user/200307.mbox/%3CLaw11-OE
> 35m2gymxwmf00059...@hotmail.com%3e
>
>
>
> 2011/1/12 Lukasz Lenart :
>> 2011/1/12 
>>> Could some one help me on this please with some example?
>>
>> Please read a bit about Preparable interface
>>
>
http://struts.apache.org/2.x/struts2-core/apidocs/com/opensymphony/xwork2/Pr
> eparable.html
>> http://struts.apache.org/2.2.1.1/docs/prepare-interceptor.html
>>
>>
>> Regards
>> --
>> Łukasz
>> + 48 606 323 122 http://www.lenart.org.pl/
>> Kapituła Javarsovia http://javarsovia.pl
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>>
>
>
>
> --
> Maurizio Cucchiara
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>
>



-- 
Maurizio Cucchiara

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




smime.p7s
Description: S/MIME cryptographic signature


Re: retaining the values in html:select multiple="true" in jsp + collection + struts

2011-01-12 Thread Maurizio Cucchiara
Here it the mail content:

Just to confirm,  I dont need to place the following

  
  
  

In my pages? It is cool not to see these repeated lines
in all my pages

-Dan



2011/1/12  :
> Lukasz,
>
>    Yes, I am using Struts 1.3.8.  I don't think Interceptor is supported in
> it.  I tried the link you shared, but still it is not working.  Could you
> please share me the right example to fix this ?
>
> Best Regards,
> Vikram
> -Original Message-
> From: Maurizio Cucchiara [mailto:maurizio.cucchi...@gmail.com]
> Sent: Wednesday, January 12, 2011 2:13 PM
> To: Struts Users Mailing List; lukasz.len...@gmail.com
> Subject: Re: retaining the values in html:select multiple="true" in jsp +
> collection + struts
>
> Lukasz,
> I'm afraid he is using struts 1.
> Anyway, I think that when user goes back using the browser's arrow,
> the page is loaded from cache. So It shouldn't be a  matter of Struts.
>
> My suggest is that you should find a way to avoid http caching [1] (I
> don't know if it works, I usually use header-based approach).
>
> http://mail-archives.apache.org/mod_mbox/struts-user/200307.mbox/%3CLaw11-OE
> 35m2gymxwmf00059...@hotmail.com%3e
>
>
>
> 2011/1/12 Lukasz Lenart :
>> 2011/1/12 
>>> Could some one help me on this please with some example?
>>
>> Please read a bit about Preparable interface
>>
> http://struts.apache.org/2.x/struts2-core/apidocs/com/opensymphony/xwork2/Pr
> eparable.html
>> http://struts.apache.org/2.2.1.1/docs/prepare-interceptor.html
>>
>>
>> Regards
>> --
>> Łukasz
>> + 48 606 323 122 http://www.lenart.org.pl/
>> Kapituła Javarsovia http://javarsovia.pl
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>>
>
>
>
> --
> Maurizio Cucchiara
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>
>



-- 
Maurizio Cucchiara

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



RE: retaining the values in html:select multiple="true" in jsp + collection + struts

2011-01-12 Thread vikram.g.byali
Lukasz,

Yes, I am using Struts 1.3.8.  I don't think Interceptor is supported in
it.  I tried the link you shared, but still it is not working.  Could you
please share me the right example to fix this ?
 
Best Regards,
Vikram
-Original Message-
From: Maurizio Cucchiara [mailto:maurizio.cucchi...@gmail.com] 
Sent: Wednesday, January 12, 2011 2:13 PM
To: Struts Users Mailing List; lukasz.len...@gmail.com
Subject: Re: retaining the values in html:select multiple="true" in jsp +
collection + struts

Lukasz,
I'm afraid he is using struts 1.
Anyway, I think that when user goes back using the browser's arrow,
the page is loaded from cache. So It shouldn't be a  matter of Struts.

My suggest is that you should find a way to avoid http caching [1] (I
don't know if it works, I usually use header-based approach).

http://mail-archives.apache.org/mod_mbox/struts-user/200307.mbox/%3CLaw11-OE
35m2gymxwmf00059...@hotmail.com%3e



2011/1/12 Lukasz Lenart :
> 2011/1/12 
>> Could some one help me on this please with some example?
>
> Please read a bit about Preparable interface
>
http://struts.apache.org/2.x/struts2-core/apidocs/com/opensymphony/xwork2/Pr
eparable.html
> http://struts.apache.org/2.2.1.1/docs/prepare-interceptor.html
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
> Kapituła Javarsovia http://javarsovia.pl
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>



-- 
Maurizio Cucchiara

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




smime.p7s
Description: S/MIME cryptographic signature


Re: retaining the values in html:select multiple="true" in jsp + collection + struts

2011-01-12 Thread Lukasz Lenart
2011/1/12 Maurizio Cucchiara :
> Lukasz,
> I'm afraid he is using struts 1.

You're right, I missed that out ;-)


Kind reagds
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/
Kapituła Javarsovia http://javarsovia.pl

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



Re: retaining the values in html:select multiple="true" in jsp + collection + struts

2011-01-12 Thread Maurizio Cucchiara
Lukasz,
I'm afraid he is using struts 1.
Anyway, I think that when user goes back using the browser's arrow,
the page is loaded from cache. So It shouldn't be a  matter of Struts.

My suggest is that you should find a way to avoid http caching [1] (I
don't know if it works, I usually use header-based approach).

http://mail-archives.apache.org/mod_mbox/struts-user/200307.mbox/%3claw11-oe35m2gymxwmf00059...@hotmail.com%3e



2011/1/12 Lukasz Lenart :
> 2011/1/12 
>> Could some one help me on this please with some example?
>
> Please read a bit about Preparable interface
> http://struts.apache.org/2.x/struts2-core/apidocs/com/opensymphony/xwork2/Preparable.html
> http://struts.apache.org/2.2.1.1/docs/prepare-interceptor.html
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
> Kapituła Javarsovia http://javarsovia.pl
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>



-- 
Maurizio Cucchiara

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



Re: retaining the values in html:select multiple="true" in jsp + collection + struts

2011-01-12 Thread Lukasz Lenart
2011/1/12 
> Could some one help me on this please with some example?

Please read a bit about Preparable interface
http://struts.apache.org/2.x/struts2-core/apidocs/com/opensymphony/xwork2/Preparable.html
http://struts.apache.org/2.2.1.1/docs/prepare-interceptor.html


Regards
--
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/
Kapituła Javarsovia http://javarsovia.pl

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



RE: retaining the values in html:select multiple="true" in jsp + collection + struts

2011-01-12 Thread vikram.g.byali
Could some one help me on this please with some example?

 

Thanks,

Vikram

  _  

From: Byali, Vikram G. 
Sent: Tuesday, January 11, 2011 3:48 PM
To: 'user@struts.apache.org'
Subject: retaining the values in html:select multiple="true" in jsp +
collection + struts

 

Hi,

 

I have a multiple selection box in one of the jsp:

 



  Select  Level :















   



 

  When the user clicks on "Submit" it goes to another jsp.  Now the user
clicks on the back button, the selected value in the multiple selection box
is not retained.  I need your inputs to fix this.

 

 

 

 

 

 

 

 

Best Regards,

 

 Vikramsingh G B

Accenture - IDC | BANG4 | Bangalore - 560037 | e-mail:
vikram.g.by...@accenture.com | Office: +91 80 4186 3008 | Mobile: +91 99865
93789 | MOC :vikram.g.by...@accenture.com

 

<>

smime.p7s
Description: S/MIME cryptographic signature


retaining the values in html:select multiple="true" in jsp + collection + struts

2011-01-11 Thread vikram.g.byali
Hi,



I have a multiple selection box in one of the jsp:





  Select  Level :















   





  When the user clicks on "Submit" it goes to another jsp.  Now the user clicks 
on the back button, the selected value in the multiple selection box is not 
retained.  I need your inputs to fix this.

















Best Regards,



 Vikramsingh G B

Accenture - IDC | BANG4 | Bangalore - 560037 | e-mail: 
vikram.g.by...@accenture.com | Office: +91 
80 4186 3008 | Mobile: +91 99865 93789 | MOC :vikram.g.by...@accenture.com





This message is for the designated recipient only and may contain privileged, 
proprietary, or otherwise private information.  If you have received it in 
error, please notify the sender immediately and delete the original.  Any other 
use of the email by you is prohibited.


retaining the values in html:select multiple="true" in jsp + collection + struts

2011-01-11 Thread vikram.g.byali
Hi,

 

I have a multiple selection box in one of the jsp:

 



  Select  Level :















   



 

  When the user clicks on "Submit" it goes to another jsp.  Now the user
clicks on the back button, the selected value in the multiple selection box
is not retained.  I need your inputs to fix this.

 





smime.p7s
Description: S/MIME cryptographic signature


Re: How to set the value of request scope in a interceptor and get it in jsp?

2010-10-07 Thread Li Ying
Hi lunch716:

For more detail information about this issue,
you can read these documents:
  http://struts.apache.org/2.2.1/docs/ognl.html
  http://struts.apache.org/2.2.1/docs/ognl-basics.html

And in [ognl-basics.html], it says:
  "#request['foo'] or #request.foo"
means
  "request attribute ['foo'] (request.getAttribute())"

So i believe that "#request.key" and #request['key']
should work both.


2010/10/7 

> Hi,
>
> Thanks Li and Maurizio!
>
> Here is the solution.
>  
>
> I really appreciate you guys because I spent a whole day for this problem.
>
> Thanks a lot!
>


Re: How to set the value of request scope in a interceptor and get it in jsp?

2010-10-07 Thread lunch716
Hi,

Thanks Li and Maurizio!

Here is the solution.
 

I really appreciate you guys because I spent a whole day for this problem.

Thanks a lot!

--- Maurizio Cucchiara  wrote:

> This would work:
> 
> 
> Maurizio Cucchiara
> 


--
Learn more about breast cancer - Pink Ribbon Campaign 2010
http://yj.pn/JAy9L7

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



Re: How to set the value of request scope in a interceptor and get it in jsp?

2010-10-07 Thread Maurizio Cucchiara
This would work:


Maurizio Cucchiara

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



Re: How to set the value of request scope in a interceptor and get it in jsp?

2010-10-07 Thread Li Ying
try





2010/10/7 

> Hi,
>
> When I set a value in my interceptor,I could not get it in a jsp.
> How to do that?
>
>
> ### my interceptor
> public class HogeIntercepter extends AbstractInterceptor {
>
>   @Override
>   public String intercept(ActionInvocation invocation) throws Exception {
>  HttpServletRequest request = ServletActionContext.getRequest();
>
>  request.setAttribute("key", "aaa");
>
> return invocation.invoke();
>   }
> }
>
> ### jsp
>  -> it's return 0.
>  -> it's return 0.
> <% out.println(request.getAttribute("key")); %> -> return "aaa"
>
>
>
> FYI.
> I also refered the following the URL
>
> http://stackoverflow.com/questions/1804266/struts2-understanding-the-value-stack
> but I could not get it in a jsp.
>
>   public String intercept(ActionInvocation invocation) throws Exception {
>
> Map map= new HashMap();
> map.put("key", "aaa");
> invocation.getStack().push(map);
>
> return invocation.invoke();
>
> }
> Thanks.
>%>
>
> --
> Learn more about breast cancer - Pink Ribbon Campaign 2010
> http://yj.pn/JAy9L7
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


How to set the value of request scope in a interceptor and get it in jsp?

2010-10-07 Thread lunch716
Hi,

When I set a value in my interceptor,I could not get it in a jsp.
How to do that?


### my interceptor
public class HogeIntercepter extends AbstractInterceptor {

   @Override
   public String intercept(ActionInvocation invocation) throws Exception {
  HttpServletRequest request = ServletActionContext.getRequest();
 
  request.setAttribute("key", "aaa");
 
 return invocation.invoke();
   }
}

### jsp
 -> it's return 0.
 -> it's return 0.
<% out.println(request.getAttribute("key")); %> -> return "aaa"



FYI.
I also refered the following the URL
http://stackoverflow.com/questions/1804266/struts2-understanding-the-value-stack
but I could not get it in a jsp. 

   public String intercept(ActionInvocation invocation) throws Exception {

 Map map= new HashMap();
 map.put("key", "aaa");
 invocation.getStack().push(map);
 
 return invocation.invoke();
 
}
Thanks.
%>

--
Learn more about breast cancer - Pink Ribbon Campaign 2010
http://yj.pn/JAy9L7

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



Re: XML file reloading in JSP (Caching issue)

2010-05-25 Thread Paweł Wielgus
Hi,
You can try things described here:
http://poulwiel.blogspot.com/2009/01/browser-back-button-and-caching-problem.html
i don't know if that's still acurate but maybe it will help.

Best greetings,
Paweł Wielgus.

2010/5/24 XML User :
>
> I just did.
>
> No luck. :-(
>
> Thanks for the idea.
>
>
> sandeep.furia wrote:
>>
>> how about if you change the location of the xml file, take it out of
>> web-inf and put it under the context root?
>>
>>  SDF/
>> -Original Message-
>> From: XML User [mailto:patelsame...@yahoo.com]
>> Sent: Monday, May 24, 2010 11:16 AM
>> To: user@struts.apache.org
>> Subject: Re: XML file reloading in JSP (Caching issue)
>>
>>
>> Thanks for quick reply Brian.!
>>
>> I tried adding new timestamp as parameters which generates new number
>> everytime I visit the page.
>>
>> Even added those headers setting for no cache...
>> 
>> 
>> 
>>
>> Still it is not getting updated.
>>
>>
>> Brian Thompson-5 wrote:
>>>
>>> What extra parameters have you added to the request?  AFAIK the
>>> standard solution to this type of "improper caching" problem is to
>>> simply append a random number or a timestamp to the request URL.  It's
>>> an ugly hack, but it does work even when the headers don't seem to do
>>> the trick.
>>>
>>> Of course, the "Right Way" is to rely on the no-cache headers, so you
>>> might want to do a bit more troubleshooting on that front.
>>>
>>> Hope this helps,
>>>
>>> -Brian
>>>
>>>
>>>
>>> On Mon, May 24, 2010 at 9:44 AM, XML User 
>> wrote:
>>>>
>>>> Hi,
>>>>
>>>> I am running into an issue of caching.
>>>>
>>>> I have a jsp which generates the tree view from an XML file. This XML
>>>> file
>>>> are loaded when the jsp is loaded. So whenever I add new child to the
>>>> tree
>>>> view the xml file is updated by action class and the request reloads
>> the
>>>> jsp
>>>> page which in turns reload that updated XML file.
>>>>
>>>> The issue is everytime it reloads the XML file, it gets from the
>>>> temporary
>>>> internet file which is not getting updated until I kill the browser
>> and
>>>> reload it.
>>>>
>>>> For example.
>>>>
>>>> For the first time, I have the xml file with content
>>>> .Parent 1
>>>> ...Child 1
>>>> ...Child 12
>>>> ...Child 13
>>>> .Parent 2
>>>> ...Child 2
>>>> ...Child 21
>>>>
>>>> When I call the action,to show tree then it calls the jsp file which
>>>> loads
>>>> the XML file and shows the jsp tree which works perfectly. Shows
>> complete
>>>> tree view based on XML file.
>>>>
>>>> Then I will add new child "Child 22" into ".Parent 2" then the action
>>>> will
>>>> be called and that action will update the XML file which is located
>> into
>>>> "../WEBINF/pages" and returns to the same jsp and reloads jsp which
>> also
>>>> needs to reloads the updated XML file.
>>>>
>>>> Now issue is , its not reloading that updated XML file and still
>> showing
>>>> the
>>>> tree without newly added child. When I checked internet temporary
>> files,
>>>> it
>>>> was still old XML file but at "../WEBINF/pages" location, the XML has
>>>> been
>>>> updated. So I figured out that it is an issue of caching.
>>>>
>>>> I tried to remove caching with http headers setting
>>>> <%
>>>> response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
>>>> response.setHeader("Pragma","no-cache"); //HTTP 1.0
>>>> response.setDateHeader ("Expires", 0); //prevents caching at the
>> proxy
>>>> server
>>>> %>
>>>>
>>>> Also tried with adding extra parameters to change the URL request.
>>>>
>>>> But still doen't work.
>>>>
>>>> Anyone has any suggestions, what to do next.
>>>>
>>>> Thanks for your help.
>>>>
>>>> Sorry.., If any typos or explained in too much detail.
>>>> --
&g

RE: XML file reloading in JSP (Caching issue)

2010-05-24 Thread Martin Gainty

//instead of creating a whole new page would'nt it be easier to populate the 
changed items 

//and use an ajax control to dynamically populate  a div tag on the jsp page?

   
/tags/ui/treeExampleAjaxDynamic.ftl



package org.apache.struts2.showcase;

import org.apache.struts2.showcase.ajax.tree.Category;

import com.opensymphony.xwork2.ActionSupport;

public class ShowAjaxDynamicTreeAction extends ActionSupport {
private int nodeId = 1;

public Category getCategory() {
return Category.getById(nodeId);
}

public int getNodeId() {
return nodeId;
}

public void setNodeId(int nodeId) {
this.nodeId = nodeId;
}
}


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



Showcase - UI Tag Example - Tree Example (Dynamic)














//just supply category and NodeId from from ShowAjaxDynamicTreeAction Action

?
Martin Gainty 
__ 
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, 24 May 2010 08:40:39 -0700
> From: patelsame...@yahoo.com
> To: user@struts.apache.org
> Subject: RE: XML file reloading in JSP (Caching issue)
> 
> 
> I just did.
> 
> No luck. :-(
> 
> Thanks for the idea.
> 
> 
> sandeep.furia wrote:
> > 
> > how about if you change the location of the xml file, take it out of
> > web-inf and put it under the context root?
> > 
> > SDF/
> > -Original Message-----
> > From: XML User [mailto:patelsame...@yahoo.com] 
> > Sent: Monday, May 24, 2010 11:16 AM
> > To: user@struts.apache.org
> > Subject: Re: XML file reloading in JSP (Caching issue)
> > 
> > 
> > Thanks for quick reply Brian.!
> > 
> > I tried adding new timestamp as parameters which generates new number
> > everytime I visit the page.
> > 
> > Even added those headers setting for no cache...
> > 
> > 
> > 
> > 
> > Still it is not getting updated.
> > 
> > 
> > Brian Thompson-5 wrote:
> >> 
> >> What extra parameters have you added to the request? AFAIK the
> >> standard solution to this type of "improper caching" problem is to
> >> simply append a random number or a timestamp to the request URL. It's
> >> an ugly hack, but it does work even when the headers don't seem to do
> >> the trick.
> >> 
> >> Of course, the "Right Way" is to rely on the no-cache headers, so you
> >> might want to do a bit more troubleshooting on that front.
> >> 
> >> Hope this helps,
> >> 
> >> -Brian
> >> 
> >> 
> >> 
> >> On Mon, May 24, 2010 at 9:44 AM, XML User 
> > wrote:
> >>>
> >>> Hi,
> >>>
> >>> I am running into an issue of caching.
> >>>
> >>> I have a jsp which generates the tree view from an XML file. This XML
> >>> file
> >>> are loaded when the jsp is loaded. So whenever I add new child to the
> >>> tree
> >>> view the xml file is updated by action class and the request reloads
> > the
> >>> jsp
> >>> page which in turns reload that updated XML file.
> >>>
> >>> The issue is everytime it reloads the XML file, it gets from the
> >>> temporary
> >>> internet file which is not getting updated until I kill the browser
> > and
> >>> reload it.
> >>>
> >>> For example.
> >>>
> >>> For the first time, I have the xml file with content
> >>> .Parent 1
> >>> ...Child 1
> >>> ...

RE: XML file reloading in JSP (Caching issue)

2010-05-24 Thread XML User

I just did.

No luck. :-(

Thanks for the idea.


sandeep.furia wrote:
> 
> how about if you change the location of the xml file, take it out of
> web-inf and put it under the context root?
> 
>  SDF/
> -Original Message-
> From: XML User [mailto:patelsame...@yahoo.com] 
> Sent: Monday, May 24, 2010 11:16 AM
> To: user@struts.apache.org
> Subject: Re: XML file reloading in JSP (Caching issue)
> 
> 
> Thanks for quick reply Brian.!
> 
> I tried adding new timestamp as parameters which generates new number
> everytime I visit the page.
> 
> Even added those headers setting for no cache...
> 
> 
> 
> 
> Still it is not getting updated.
> 
> 
> Brian Thompson-5 wrote:
>> 
>> What extra parameters have you added to the request?  AFAIK the
>> standard solution to this type of "improper caching" problem is to
>> simply append a random number or a timestamp to the request URL.  It's
>> an ugly hack, but it does work even when the headers don't seem to do
>> the trick.
>> 
>> Of course, the "Right Way" is to rely on the no-cache headers, so you
>> might want to do a bit more troubleshooting on that front.
>> 
>> Hope this helps,
>> 
>> -Brian
>> 
>> 
>> 
>> On Mon, May 24, 2010 at 9:44 AM, XML User 
> wrote:
>>>
>>> Hi,
>>>
>>> I am running into an issue of caching.
>>>
>>> I have a jsp which generates the tree view from an XML file. This XML
>>> file
>>> are loaded when the jsp is loaded. So whenever I add new child to the
>>> tree
>>> view the xml file is updated by action class and the request reloads
> the
>>> jsp
>>> page which in turns reload that updated XML file.
>>>
>>> The issue is everytime it reloads the XML file, it gets from the
>>> temporary
>>> internet file which is not getting updated until I kill the browser
> and
>>> reload it.
>>>
>>> For example.
>>>
>>> For the first time, I have the xml file with content
>>> .Parent 1
>>> ...Child 1
>>> ...Child 12
>>> ...Child 13
>>> .Parent 2
>>> ...Child 2
>>> ...Child 21
>>>
>>> When I call the action,to show tree then it calls the jsp file which
>>> loads
>>> the XML file and shows the jsp tree which works perfectly. Shows
> complete
>>> tree view based on XML file.
>>>
>>> Then I will add new child "Child 22" into ".Parent 2" then the action
>>> will
>>> be called and that action will update the XML file which is located
> into
>>> "../WEBINF/pages" and returns to the same jsp and reloads jsp which
> also
>>> needs to reloads the updated XML file.
>>>
>>> Now issue is , its not reloading that updated XML file and still
> showing
>>> the
>>> tree without newly added child. When I checked internet temporary
> files,
>>> it
>>> was still old XML file but at "../WEBINF/pages" location, the XML has
>>> been
>>> updated. So I figured out that it is an issue of caching.
>>>
>>> I tried to remove caching with http headers setting
>>> <%
>>> response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
>>> response.setHeader("Pragma","no-cache"); //HTTP 1.0
>>> response.setDateHeader ("Expires", 0); //prevents caching at the
> proxy
>>> server
>>> %>
>>>
>>> Also tried with adding extra parameters to change the URL request.
>>>
>>> But still doen't work.
>>>
>>> Anyone has any suggestions, what to do next.
>>>
>>> Thanks for your help.
>>>
>>> Sorry.., If any typos or explained in too much detail.
>>> --
>>> View this message in context:
>>>
> http://old.nabble.com/XML-file-reloading-in-JSP-%28Caching-issue%29-tp28
> 657737p28657737.html
>>> Sent from the Struts - User mailing list archive at Nabble.com.
>>>
>>>
>>> -
>>> 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: XML file reloading in JSP (Caching issue)

2010-05-24 Thread sandeep.furia
how about if you change the location of the xml file, take it out of
web-inf and put it under the context root?

 SDF/
-Original Message-
From: XML User [mailto:patelsame...@yahoo.com] 
Sent: Monday, May 24, 2010 11:16 AM
To: user@struts.apache.org
Subject: Re: XML file reloading in JSP (Caching issue)


Thanks for quick reply Brian.!

I tried adding new timestamp as parameters which generates new number
everytime I visit the page.

Even added those headers setting for no cache...




Still it is not getting updated.


Brian Thompson-5 wrote:
> 
> What extra parameters have you added to the request?  AFAIK the
> standard solution to this type of "improper caching" problem is to
> simply append a random number or a timestamp to the request URL.  It's
> an ugly hack, but it does work even when the headers don't seem to do
> the trick.
> 
> Of course, the "Right Way" is to rely on the no-cache headers, so you
> might want to do a bit more troubleshooting on that front.
> 
> Hope this helps,
> 
> -Brian
> 
> 
> 
> On Mon, May 24, 2010 at 9:44 AM, XML User 
wrote:
>>
>> Hi,
>>
>> I am running into an issue of caching.
>>
>> I have a jsp which generates the tree view from an XML file. This XML
>> file
>> are loaded when the jsp is loaded. So whenever I add new child to the
>> tree
>> view the xml file is updated by action class and the request reloads
the
>> jsp
>> page which in turns reload that updated XML file.
>>
>> The issue is everytime it reloads the XML file, it gets from the
>> temporary
>> internet file which is not getting updated until I kill the browser
and
>> reload it.
>>
>> For example.
>>
>> For the first time, I have the xml file with content
>> .Parent 1
>> ...Child 1
>> ...Child 12
>> ...Child 13
>> .Parent 2
>> ...Child 2
>> ...Child 21
>>
>> When I call the action,to show tree then it calls the jsp file which
>> loads
>> the XML file and shows the jsp tree which works perfectly. Shows
complete
>> tree view based on XML file.
>>
>> Then I will add new child "Child 22" into ".Parent 2" then the action
>> will
>> be called and that action will update the XML file which is located
into
>> "../WEBINF/pages" and returns to the same jsp and reloads jsp which
also
>> needs to reloads the updated XML file.
>>
>> Now issue is , its not reloading that updated XML file and still
showing
>> the
>> tree without newly added child. When I checked internet temporary
files,
>> it
>> was still old XML file but at "../WEBINF/pages" location, the XML has
>> been
>> updated. So I figured out that it is an issue of caching.
>>
>> I tried to remove caching with http headers setting
>> <%
>> response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
>> response.setHeader("Pragma","no-cache"); //HTTP 1.0
>> response.setDateHeader ("Expires", 0); //prevents caching at the
proxy
>> server
>> %>
>>
>> Also tried with adding extra parameters to change the URL request.
>>
>> But still doen't work.
>>
>> Anyone has any suggestions, what to do next.
>>
>> Thanks for your help.
>>
>> Sorry.., If any typos or explained in too much detail.
>> --
>> View this message in context:
>>
http://old.nabble.com/XML-file-reloading-in-JSP-%28Caching-issue%29-tp28
657737p28657737.html
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> -
>> 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
> 
> 
> 

-- 
View this message in context:
http://old.nabble.com/XML-file-reloading-in-JSP-%28Caching-issue%29-tp28
657737p28658007.html
Sent from the Struts - User mailing list archive at Nabble.com.


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

Please do not transmit orders or instructions regarding a UBS
account electronically, including but not limited to e-mail,
fax, text or instant messaging. The information provided in
this e-mail or any attachments is not an official transaction

Re: XML file reloading in JSP (Caching issue)

2010-05-24 Thread XML User

Thanks for quick reply Brian.!

I tried adding new timestamp as parameters which generates new number
everytime I visit the page.

Even added those headers setting for no cache...




Still it is not getting updated.


Brian Thompson-5 wrote:
> 
> What extra parameters have you added to the request?  AFAIK the
> standard solution to this type of "improper caching" problem is to
> simply append a random number or a timestamp to the request URL.  It's
> an ugly hack, but it does work even when the headers don't seem to do
> the trick.
> 
> Of course, the "Right Way" is to rely on the no-cache headers, so you
> might want to do a bit more troubleshooting on that front.
> 
> Hope this helps,
> 
> -Brian
> 
> 
> 
> On Mon, May 24, 2010 at 9:44 AM, XML User  wrote:
>>
>> Hi,
>>
>> I am running into an issue of caching.
>>
>> I have a jsp which generates the tree view from an XML file. This XML
>> file
>> are loaded when the jsp is loaded. So whenever I add new child to the
>> tree
>> view the xml file is updated by action class and the request reloads the
>> jsp
>> page which in turns reload that updated XML file.
>>
>> The issue is everytime it reloads the XML file, it gets from the
>> temporary
>> internet file which is not getting updated until I kill the browser and
>> reload it.
>>
>> For example.
>>
>> For the first time, I have the xml file with content
>> .Parent 1
>> ...Child 1
>> ...Child 12
>> ...Child 13
>> .Parent 2
>> ...Child 2
>> ...Child 21
>>
>> When I call the action,to show tree then it calls the jsp file which
>> loads
>> the XML file and shows the jsp tree which works perfectly. Shows complete
>> tree view based on XML file.
>>
>> Then I will add new child "Child 22" into ".Parent 2" then the action
>> will
>> be called and that action will update the XML file which is located into
>> "../WEBINF/pages" and returns to the same jsp and reloads jsp which also
>> needs to reloads the updated XML file.
>>
>> Now issue is , its not reloading that updated XML file and still showing
>> the
>> tree without newly added child. When I checked internet temporary files,
>> it
>> was still old XML file but at "../WEBINF/pages" location, the XML has
>> been
>> updated. So I figured out that it is an issue of caching.
>>
>> I tried to remove caching with http headers setting
>> <%
>> response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
>> response.setHeader("Pragma","no-cache"); //HTTP 1.0
>> response.setDateHeader ("Expires", 0); //prevents caching at the proxy
>> server
>> %>
>>
>> Also tried with adding extra parameters to change the URL request.
>>
>> But still doen't work.
>>
>> Anyone has any suggestions, what to do next.
>>
>> Thanks for your help.
>>
>> Sorry.., If any typos or explained in too much detail.
>> --
>> View this message in context:
>> http://old.nabble.com/XML-file-reloading-in-JSP-%28Caching-issue%29-tp28657737p28657737.html
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> -
>> 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
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/XML-file-reloading-in-JSP-%28Caching-issue%29-tp28657737p28658007.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: XML file reloading in JSP (Caching issue)

2010-05-24 Thread Brian Thompson
What extra parameters have you added to the request?  AFAIK the
standard solution to this type of "improper caching" problem is to
simply append a random number or a timestamp to the request URL.  It's
an ugly hack, but it does work even when the headers don't seem to do
the trick.

Of course, the "Right Way" is to rely on the no-cache headers, so you
might want to do a bit more troubleshooting on that front.

Hope this helps,

-Brian



On Mon, May 24, 2010 at 9:44 AM, XML User  wrote:
>
> Hi,
>
> I am running into an issue of caching.
>
> I have a jsp which generates the tree view from an XML file. This XML file
> are loaded when the jsp is loaded. So whenever I add new child to the tree
> view the xml file is updated by action class and the request reloads the jsp
> page which in turns reload that updated XML file.
>
> The issue is everytime it reloads the XML file, it gets from the temporary
> internet file which is not getting updated until I kill the browser and
> reload it.
>
> For example.
>
> For the first time, I have the xml file with content
> .Parent 1
> ...Child 1
> ...Child 12
> ...Child 13
> .Parent 2
> ...Child 2
> ...Child 21
>
> When I call the action,to show tree then it calls the jsp file which loads
> the XML file and shows the jsp tree which works perfectly. Shows complete
> tree view based on XML file.
>
> Then I will add new child "Child 22" into ".Parent 2" then the action will
> be called and that action will update the XML file which is located into
> "../WEBINF/pages" and returns to the same jsp and reloads jsp which also
> needs to reloads the updated XML file.
>
> Now issue is , its not reloading that updated XML file and still showing the
> tree without newly added child. When I checked internet temporary files, it
> was still old XML file but at "../WEBINF/pages" location, the XML has been
> updated. So I figured out that it is an issue of caching.
>
> I tried to remove caching with http headers setting
> <%
> response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
> response.setHeader("Pragma","no-cache"); //HTTP 1.0
> response.setDateHeader ("Expires", 0); //prevents caching at the proxy
> server
> %>
>
> Also tried with adding extra parameters to change the URL request.
>
> But still doen't work.
>
> Anyone has any suggestions, what to do next.
>
> Thanks for your help.
>
> Sorry.., If any typos or explained in too much detail.
> --
> View this message in context: 
> http://old.nabble.com/XML-file-reloading-in-JSP-%28Caching-issue%29-tp28657737p28657737.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> 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



XML file reloading in JSP (Caching issue)

2010-05-24 Thread XML User

Hi,

I am running into an issue of caching. 

I have a jsp which generates the tree view from an XML file. This XML file
are loaded when the jsp is loaded. So whenever I add new child to the tree
view the xml file is updated by action class and the request reloads the jsp
page which in turns reload that updated XML file.

The issue is everytime it reloads the XML file, it gets from the temporary
internet file which is not getting updated until I kill the browser and
reload it.

For example.

For the first time, I have the xml file with content
.Parent 1
...Child 1
...Child 12
...Child 13
.Parent 2
...Child 2
...Child 21

When I call the action,to show tree then it calls the jsp file which loads
the XML file and shows the jsp tree which works perfectly. Shows complete
tree view based on XML file.

Then I will add new child "Child 22" into ".Parent 2" then the action will
be called and that action will update the XML file which is located into
"../WEBINF/pages" and returns to the same jsp and reloads jsp which also
needs to reloads the updated XML file.  

Now issue is , its not reloading that updated XML file and still showing the
tree without newly added child. When I checked internet temporary files, it
was still old XML file but at "../WEBINF/pages" location, the XML has been
updated. So I figured out that it is an issue of caching.

I tried to remove caching with http headers setting
<%
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", 0); //prevents caching at the proxy
server
%>

Also tried with adding extra parameters to change the URL request.

But still doen't work.

Anyone has any suggestions, what to do next.

Thanks for your help.

Sorry.., If any typos or explained in too much detail.
-- 
View this message in context: 
http://old.nabble.com/XML-file-reloading-in-JSP-%28Caching-issue%29-tp28657737p28657737.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: Change form bean properties in JSP

2010-05-20 Thread Robert Graf-Waczenski

Am 20.05.2010 13:16, schrieb Manoj Singh:

Hi,

Thanks for your reply.

Please let me know how to do it?

Thanks,
Manoj

On Thu, May 20, 2010 at 4:42 PM, Robert Graf-Waczenskiwrote:

   

Am 20.05.2010 12:50, schrieb Manoj Singh:

  Hi,
 

Is it possible to change the value of form bean properties in JSP Page?

If yes, then please let me know.

Thanks,
Manoj



   

Yes.


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


 
   
Simple answer: Call the appropriate setter method of your form bean in 
the JSP.
Less trivial options exist but depend on what you are trying to 
accomplish, your Struts version etc., none of which you elaborated in 
your original posting, hence my short reply :-)


Robert


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



Re: Change form bean properties in JSP

2010-05-20 Thread Manoj Singh
Hi,

Thanks for your reply.

Please let me know how to do it?

Thanks,
Manoj

On Thu, May 20, 2010 at 4:42 PM, Robert Graf-Waczenski wrote:

> Am 20.05.2010 12:50, schrieb Manoj Singh:
>
>  Hi,
>>
>> Is it possible to change the value of form bean properties in JSP Page?
>>
>> If yes, then please let me know.
>>
>> Thanks,
>> Manoj
>>
>>
>>
> Yes.
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


Re: Change form bean properties in JSP

2010-05-20 Thread Robert Graf-Waczenski

Am 20.05.2010 12:50, schrieb Manoj Singh:

Hi,

Is it possible to change the value of form bean properties in JSP Page?

If yes, then please let me know.

Thanks,
Manoj

   

Yes.


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



Change form bean properties in JSP

2010-05-20 Thread Manoj Singh
Hi,

Is it possible to change the value of form bean properties in JSP Page?

If yes, then please let me know.

Thanks,
Manoj


Re: load dynamically created files in jsp

2010-05-14 Thread Upasana Sharma
Hi i can access the folder from url

http://localhost:8080/ui/images/JavaTemp2261198016333434327.jpg


i am using something like




but this returns me
images/JavaTemp2261198016333434327.jpg

not the relative url using context
can u just help me out how should i deal with the s:url tag

thanks in advance



On Fri, May 14, 2010 at 11:33 AM, Upasana Sharma wrote:

> Hi
>
> I have a scenario where i create a temporary dynamic image file from the
> database and try to show it on my jsp.
> The file url shows the image properly, but when in jsp , my browser says
> that "Firefox doesn't know how to open this address, because the protocol
> (d) isn't associated with any program"
>
> the url i get is like
>
> D:\myWorkspace\ui\WebContent\images\JavaTemp2261198016333434327.jpg, that
> is my struts project folder.
>
> How can i make the image accessible to my jsp.
>
> --
> Thanks and Regards
> Upasana Sharma


load dynamically created files in jsp

2010-05-13 Thread Upasana Sharma
Hi

I have a scenario where i create a temporary dynamic image file from the
database and try to show it on my jsp.
The file url shows the image properly, but when in jsp , my browser says
that "Firefox doesn't know how to open this address, because the protocol
(d) isn't associated with any program"

the url i get is like

D:\myWorkspace\ui\WebContent\images\JavaTemp2261198016333434327.jpg, that is
my struts project folder.

How can i make the image accessible to my jsp.

-- 
Thanks and Regards
Upasana Sharma


problem in struts 2 tag in jsp calling spring bean

2010-04-13 Thread Supratim Bandyopadhyaya
Greetings to all,

I have a spring dao class like this

public class RoleDaoImpl extends SimpleJdbcDaoSupport implements RoleDao {

public Role findRoleById(Long id) {
  .


and I have added it to spring as






when I am calling a method in this dao from struts 2 tag
like this ... (this is a direct jsp call, not forwarding from an action)



this select list is not populating. How can I fix this.
I am using struts spring plug-in by the way.

Thanks in advance.
Supratim.


RE: Displaying an image in JSP in struts+tiles project

2010-01-11 Thread Aruna Ponaka

I wrote an action class and it worked. 
I called the action class like below...

img src="

and the struts.xml 

 
 
   books
 


ImageAction.java


import java.io.OutputStream;
import java.sql.Blob;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;

import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.ActionSupport;

public class ImageAction extends ActionSupport {

private static final long serialVersionUID = 1L;
private byte[] img=null;
private int id = 0;
Blob image = null;
   Connection con = null;
   Statement stmt = null;
   ResultSet rs = null;
   byte[] imgData = null;
   OutputStream o = null;
   HttpServletResponse response = ServletActionContext.getResponse();
   
public String execute() {
try {
Class.forName("com.mysql.jdbc.Driver");
  con =
DriverManager.getConnection("jdbc:mysql://localhost:3306/test","root","test");
  stmt = con.createStatement();
  rs = stmt.executeQuery("select * from books_tb where
category='Social and Economic' order by publish_date desc");
  
  while (rs.next()) {
image = rs.getBlob(10);
imgData = 
image.getBytes(1,(int)image.length()); 
  } 
  
response.setContentType("image/jpeg");
System.out.println("id   "+getId());
OutputStream out = response.getOutputStream();
   out.write(imgData);
out.close();
return null;
}
catch (Exception e) {
  System.out.println(e.getMessage());
} 
return null;
  }


I was using doDefault function earlier and was trying to return the
outputstream, but that will not work and it should return null.

Hope this is useful to someone....

-- 
View this message in context: 
http://old.nabble.com/Displaying-an-image-in-JSP-in-struts%2Btiles-project-tp27020146p27116930.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



RE: Displaying an image in JSP in struts+tiles project

2010-01-05 Thread Kawczynski, David
Being a fan of the KISS policy... I played around with 
this but didn't have the time to figure it out, so I 
made the URL spat out by struts2 points to a servlet 
instead of struts2.  

(Note that my web.xml has struts2 configured to listen 
for *.action rather then slash-star)

Good luck & please let me know what your solution is.

Thanks!
-dave


> -Original Message-
> From: Aruna Ponaka [mailto:aruna@gmail.com] 
> Sent: Monday, January 04, 2010 5:09 PM
> To: user@struts.apache.org
> Subject: Displaying an image in JSP in struts+tiles project
> 
> 
> Hi,
> 
> Am building an application in struts2 and tiles. My requirement is to
> retrieve an image blob from mysql database and display the 
> image in a jsp
> using img tag as below..
> 
> img src="" 
> 
> Part of my struts.xml is as below:
> 
>  
> 
>  class="org.apache.struts2.views.tiles.TilesResult" />
>  class="com.icensa.action.MyBytesResult" >
> 
>  
> 
>  
> 
> My MyBytesResult class is:
> 
> public class MyBytesResult implements Result {
> 
>   private static final long serialVersionUID = 1L;
>   
> 
>   public void execute(ActionInvocation invocation) throws 
> Exception {
>   
>   MyAction action = (MyAction) invocation.getAction();
>   HttpServletResponse response = 
> ServletActionContext.getResponse();
> 
> response.setContentType("image/jpeg");
>   
> //response.setContentLength(action.getMyContentLength());
> 
>   
> response.getOutputStream().write(action.getMyImageInBytes());
>   response.getOutputStream().flush();
>   }
> 
> }
> 
> And MyAction class is:
> 
> public class MyAction extends ActionSupport {
>   
>   private static final long serialVersionUID = 1L;
>   Blob image = null;
> Connection con = null;
> Statement stmt = null;
> ResultSet rs = null;
> byte[] imgData = null;
> OutputStream o = null;
> HttpServletResponse response = ServletActionContext.getResponse();
>   public String doDefault() {
>   System.out.println("doDefault()");
>   try {
> Class.forName("com.mysql.jdbc.Driver");
> con =
> DriverManager.getConnection("jdbc:mysql://localhost:3306/proje
> ct","root","pass");
> stmt = con.createStatement();
> rs = stmt.executeQuery("select * from 
> books_tb where
> category='General' order by publish_date desc");
> while (rs.next()) {
>   image = rs.getBlob(11);
>   imgData = 
> image.getBytes(1,(int)image.length()); 
>} 
>  }
>   catch (Exception e) {
> System.out.println(e.getMessage());   
>  
>   } 
>   return "myImageResult";
> }
> 
> public byte[] getMyImageInBytes() { 
> System.out.println("getMyImageInBytes()");
> try{
> 
> }
> catch (Exception e) {
> System.out.println(e.getMessage());
>
>} 
> return imgData;
> }
> 
>   //  public String getMyContentType() { }
>   //  public String getMyContentDisposition() {}
>   //  public int getMyContentLength() { }
>   //  public int getMyBufferSize() { }
> 
>   }
> 
> when i run the code the image is not displayed and I get an 
> error saying
> No result defined for action com.action.MyAction and result success
> 
> In struts.xml is I provide reslut name="success" and the jsp, 
> it does not
> throw an error but not displaying the image. However in any 
> case it is not
> going to MyAction.java. What could i do to rectify this?
> Could provide you with required code if necessary..
> 
> Thanks,
> Aruna 
> 
> -- 
> View this message in context: 
> http://old.nabble.com/Displaying-an-image-in-JSP-in-struts%2Bt
iles-project-tp27020146p27020146.html
> Sent from the Struts - User mailing list archive at Nabble.com.
> 
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 
> 
Notice:  This e-ma

Displaying an image in JSP in struts+tiles project

2010-01-04 Thread Aruna Ponaka

Hi,

Am building an application in struts2 and tiles. My requirement is to
retrieve an image blob from mysql database and display the image in a jsp
using img tag as below..

img src="" 

Part of my struts.xml is as below:

 




 

 

My MyBytesResult class is:

public class MyBytesResult implements Result {

private static final long serialVersionUID = 1L;


public void execute(ActionInvocation invocation) throws Exception {

MyAction action = (MyAction) invocation.getAction();
HttpServletResponse response = 
ServletActionContext.getResponse();

response.setContentType("image/jpeg");
//response.setContentLength(action.getMyContentLength());

response.getOutputStream().write(action.getMyImageInBytes());
response.getOutputStream().flush();
}

}

And MyAction class is:

public class MyAction extends ActionSupport {

private static final long serialVersionUID = 1L;
Blob image = null;
Connection con = null;
Statement stmt = null;
ResultSet rs = null;
byte[] imgData = null;
OutputStream o = null;
HttpServletResponse response = ServletActionContext.getResponse();
public String doDefault() {
System.out.println("doDefault()");
try {
  Class.forName("com.mysql.jdbc.Driver");
  con =
DriverManager.getConnection("jdbc:mysql://localhost:3306/project","root","pass");
  stmt = con.createStatement();
  rs = stmt.executeQuery("select * from books_tb where
category='General' order by publish_date desc");
  while (rs.next()) {
image = rs.getBlob(11);
imgData = 
image.getBytes(1,(int)image.length()); 
 } 
   }
catch (Exception e) {
  System.out.println(e.getMessage());
} 
return "myImageResult";
  }

  public byte[] getMyImageInBytes() { 
  System.out.println("getMyImageInBytes()");
  try{
  
  }
  catch (Exception e) {
  System.out.println(e.getMessage());
 
 } 
  return imgData;
  }

//  public String getMyContentType() { }
//  public String getMyContentDisposition() {}
//  public int getMyContentLength() { }
//  public int getMyBufferSize() { }

}

when i run the code the image is not displayed and I get an error saying
No result defined for action com.action.MyAction and result success

In struts.xml is I provide reslut name="success" and the jsp, it does not
throw an error but not displaying the image. However in any case it is not
going to MyAction.java. What could i do to rectify this?
Could provide you with required code if necessary..

Thanks,
Aruna 

-- 
View this message in context: 
http://old.nabble.com/Displaying-an-image-in-JSP-in-struts%2Btiles-project-tp27020146p27020146.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: Question about OGNL in JSP

2009-11-09 Thread Oscar Calderón
Ohh ok, thanks. I googled about that and i found that i can add a variable
or Object to page context with this:

pageContext.setAttribute("obj", obj);

Thanks.

2009/11/9 Musachy Barroso 

> That's because creating an object in a scriptlet doesn't mean it will
> be in the page context, you need to actually add it to the context.
>
> musachy
>
> On Mon, Nov 9, 2009 at 1:47 PM, Oscar Calderón 
> wrote:
> > Hi to all, this is my first question here. I have a doubt about the use
> of
> > OGNL expressions on JSP to access to an object that i declared in a
> > scriptlet in the same JSP.
> >
> > I have the following code:
> >
> > <%
> >   AnObject obj = request.getSession().getAttribute(AnObject.OBJECT_NAME);
> >
> > %>
> >
> > 
> >visitor
> >
> >
> >something else
> >
> >
> > I read in some books that when you call attr it searches in the page and
> > other scopes to find the variable that you specify, in my case obj, but
> it
> > doesn't find it. This is the right way to access to that object?
> >
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


-- 
Visita mi blog
http://codigo-java.com
http://aeblogs.com/uiq


Re: Question about OGNL in JSP

2009-11-09 Thread Musachy Barroso
That's because creating an object in a scriptlet doesn't mean it will
be in the page context, you need to actually add it to the context.

musachy

On Mon, Nov 9, 2009 at 1:47 PM, Oscar Calderón  wrote:
> Hi to all, this is my first question here. I have a doubt about the use of
> OGNL expressions on JSP to access to an object that i declared in a
> scriptlet in the same JSP.
>
> I have the following code:
>
> <%
>   AnObject obj = request.getSession().getAttribute(AnObject.OBJECT_NAME);
>
> %>
>
> 
>                                        visitor
>                                    
>                                    
>                                        something else
>                                    
>
> I read in some books that when you call attr it searches in the page and
> other scopes to find the variable that you specify, in my case obj, but it
> doesn't find it. This is the right way to access to that object?
>

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



Question about OGNL in JSP

2009-11-09 Thread Oscar Calderón
Hi to all, this is my first question here. I have a doubt about the use of
OGNL expressions on JSP to access to an object that i declared in a
scriptlet in the same JSP.

I have the following code:

<%
   AnObject obj = request.getSession().getAttribute(AnObject.OBJECT_NAME);

%>


visitor


something else


I read in some books that when you call attr it searches in the page and
other scopes to find the variable that you specify, in my case obj, but it
doesn't find it. This is the right way to access to that object?


Wrong data being displayed in JSP page

2009-11-01 Thread Manoj Pual

Hello everybody!

I am new to this forum.I am using Struts 1.
This is my jsp page.










  : 













  : 











<%

for
(int i = 0 ; i < tariffCategoriesList.size(); i++){

Map vals = (Map) tariffCategoriesList.get(i);




<%=vals.get("description")%>

  : 





' name='tariffCat' value="<%=vals.get("tariff_Category_Id")%>"/>





<%

}

%>
















I am facing a strange problem in my application.
In the JSP Scriplet tag you could see that I am dynamically 
creating a few html text input with the help of a for-loop
When using <%=vals.get("description")%> its display the correct data on the
page(As no html elements is being used). But when I want to display the
value in ' name='tariffCat' value="<%=vals.get("tariff_Category_Id")%>"/>..
It displays the data from the bottom 5 struts html properties and not the
correct value from the List,i.e, value of















Can someone please help me out and explain why these things are happening in
my application?
F1 please..
-- 
Regards
-- 
View this message in context: 
http://old.nabble.com/Wrong-data-being-displayed-in-JSP-page-tp26156233p26156233.html
Sent from the Struts - User mailing list archive at Nabble.com.


RE: Image not loaded in jsp

2009-10-27 Thread dharhsana

Hi Vishnu,

i am using img tag in which struts bean tag ill be given to the src of image
tag.

My question is since we kept those images in webapps the images are not been
shown, only after restarting the images are been shown..

we are not saving images in the database only the path is saved,and i am
giving the path in img tag.

are else session has been lost ..


waiting for your reply.

regards,

rekha



vishnu.vyasan wrote:
> 
> Hi Rekha,
> 
> Which app server are you using?   
> Try printing the path  you got from database.   
> 
> And are you using  <%=request.getContextPath()%> ? 
>  
> Best Regards
> Vishnu NV
> Java Application Developer
> Ministry of Municipalities and Agriculture Affairs
>  
> 
> -Original Message-
> From: dharhsana [mailto:rekha.dharsh...@gmail.com] 
> Sent: Tuesday, October 27, 2009 9:30 AM
> To: user@struts.apache.org
> Subject: Image not loaded in jsp
> 
> 
> Hi to all,
> 
> I have some query regarding viewing of images in jsp page.
> 
> We are using struts with hibernate to develop our application. What we
> do is
> while inserting image ,we insert the path in the database and have
> images in
> the webapps.the image is not been loaded after uploaded.. once after
> restarting the server the image gets loaded.
> 
> We were using session factory for saving and retrieving images.
> 
> Is that we need to check the transaction of each session.. 
> 
> can any one please help me out how to solve this problem.
> 
> with regards,
> 
> Rekha.
> -- 
> View this message in context:
> http://www.nabble.com/Image-not-loaded-in-jsp-tp26072724p26072724.html
> Sent from the Struts - User mailing list archive at Nabble.com.
> 
> 
> -
> 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
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Image-not-loaded-in-jsp-tp26072724p26073226.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



RE: Image not loaded in jsp

2009-10-26 Thread Vishnu Vyasan Nelliparmbil
Hi Rekha,

Which app server are you using?   
Try printing the path  you got from database.   

And are you using  <%=request.getContextPath()%> ? 
 
Best Regards
Vishnu NV
Java Application Developer
Ministry of Municipalities and Agriculture Affairs
 

-Original Message-
From: dharhsana [mailto:rekha.dharsh...@gmail.com] 
Sent: Tuesday, October 27, 2009 9:30 AM
To: user@struts.apache.org
Subject: Image not loaded in jsp


Hi to all,

I have some query regarding viewing of images in jsp page.

We are using struts with hibernate to develop our application. What we
do is
while inserting image ,we insert the path in the database and have
images in
the webapps.the image is not been loaded after uploaded.. once after
restarting the server the image gets loaded.

We were using session factory for saving and retrieving images.

Is that we need to check the transaction of each session.. 

can any one please help me out how to solve this problem.

with regards,

Rekha.
-- 
View this message in context:
http://www.nabble.com/Image-not-loaded-in-jsp-tp26072724p26072724.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
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



Image not loaded in jsp

2009-10-26 Thread dharhsana

Hi to all,

I have some query regarding viewing of images in jsp page.

We are using struts with hibernate to develop our application. What we do is
while inserting image ,we insert the path in the database and have images in
the webapps.the image is not been loaded after uploaded.. once after
restarting the server the image gets loaded.

We were using session factory for saving and retrieving images.

Is that we need to check the transaction of each session.. 

can any one please help me out how to solve this problem.

with regards,

Rekha.
-- 
View this message in context: 
http://www.nabble.com/Image-not-loaded-in-jsp-tp26072724p26072724.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: [OT] Re: How to access enum in jsp?

2009-09-07 Thread 谢冬鸣
 you can use OGNL syntax "@cl...@field"
see: http://www.opensymphony.com/ognl/html/LanguageGuide/staticFields.html

On Mon, Sep 7, 2009 at 05:12, Dave Newton  wrote:

> Martin Gainty wrote:
>
>> the original solution i sent was OGNL
>>
>
> So why did you write:
>
> >>> yes javap would reveal the 'mangled' name
>
> If there's a back-channel conversation that isn't being posted to the list
> it's just confusing to introduce little chunks of it, and there was never
> any solution other than Pawel's posted to the list.
>
>
> Dave
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>


-- 
*
Xie Dongming
MAIL(Gtalk):msys@gmail.com
Mobie:+86-15071342225

*

-
俺终身奋斗的最低革命纲领:农妇--山泉--有点儿田


[OT] Re: How to access enum in jsp?

2009-09-06 Thread Dave Newton

Martin Gainty wrote:

the original solution i sent was OGNL


So why did you write:

>>> yes javap would reveal the 'mangled' name

If there's a back-channel conversation that isn't being posted to the 
list it's just confusing to introduce little chunks of it, and there was 
never any solution other than Pawel's posted to the list.


Dave


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



RE: How to access enum in jsp?

2009-09-06 Thread Martin Gainty

the original solution i sent was OGNL  

Martin Gainty 
__ 
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: Sun, 6 Sep 2009 16:38:23 -0400
> From: newton.d...@yahoo.com
> To: user@struts.apache.org
> Subject: Re: How to access enum in jsp?
> 
> Martin Gainty wrote:
> > yes javap would reveal the 'mangled' name 
> 
> That's not a "mangled" name; that's just OGNL syntax.
> 
> Dave
> 
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 

_
Hotmail® is up to 70% faster. Now good news travels really fast. 
http://windowslive.com/online/hotmail?ocid=PID23391::T:WLMTAGL:ON:WL:en-US:WM_HYGN_faster:082009

Re: How to access enum in jsp?

2009-09-06 Thread Dave Newton

Martin Gainty wrote:
yes javap would reveal the 'mangled' name 


That's not a "mangled" name; that's just OGNL syntax.

Dave


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



RE: How to access enum in jsp?

2009-09-06 Thread Martin Gainty

yes javap would reveal the 'mangled' name 
works well for determining exact name of inner classes too
 
thanks
Martin Gainty 
__ 
Jogi és Bizalmassági kinyilatkoztatás
 Ez az
üzenet bizalmas.  Ha nem ön az akinek szánva volt, akkor kérjük, hogy
jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának
készítése nem megengedett.  Ez az üzenet csak ismeret cserét szolgál és
semmiféle jogi alkalmazhatósága sincs.  Mivel az electronikus üzenetek
könnyen megváltoztathatóak, ezért minket semmi felelöség nem terhelhet
ezen üzenet tartalma miatt.






> Date: Sun, 6 Sep 2009 10:10:48 -0700
> Subject: Re: How to access enum in jsp?
> From: bill98...@gmail.com
> To: user@struts.apache.org
> 
> Ah ha! So when code the test attribute like this:
> 
> test="%{state == @com.yata.yata.actionst...@list}"
> 
> it works. Thanks, Pawel!
> 
> - Bill
> 
> P.S. That syntax sux :-)
> 
> 2009/9/6 Paweł Wielgus 
> 
> > Hi Bill,
> > You are comparing string with enum by == operator, so it's always false.
> > Also if You see this value in debug it's the effect of toString() method.
> > You can access enum like this com.something.actionst...@none
> > if i remebmer correctly.
> >
> > Best greetings,
> > Paweł Wielgus.
> >
> >
> >

_
With Windows Live, you can organize, edit, and share your photos.
http://www.windowslive.com/Desktop/PhotoGallery

Re: How to access enum in jsp?

2009-09-06 Thread Bill Bohnenberger
Ah ha! So when code the test attribute like this:

test="%{state == @com.yata.yata.actionst...@list}"

it works. Thanks, Pawel!

- Bill

P.S. That syntax sux :-)

2009/9/6 Paweł Wielgus 

> Hi Bill,
> You are comparing string with enum by == operator, so it's always false.
> Also if You see this value in debug it's the effect of toString() method.
> You can access enum like this com.something.actionst...@none
> if i remebmer correctly.
>
> Best greetings,
> Paweł Wielgus.
>
>
>


Re: How to access enum in jsp?

2009-09-06 Thread Paweł Wielgus
Hi Bill,
You are comparing string with enum by == operator, so it's always false.
Also if You see this value in debug it's the effect of toString() method.
You can access enum like this com.something.actionst...@none
if i remebmer correctly.

Best greetings,
Paweł Wielgus.


2009/9/6 Bill Bohnenberger :
> How do I reference an enum variable in an  test attribute?
> This is the situation, and the results I get:
>
> 1) I have a enum defined as
>
>    public enum ActionState
>    {
>        NONE, INIT, LIST, ADD, EDIT, DELETE ...
>    }
>
> 2) I have a variable of this type in my action class:
>
>    ActionState state;
>
> 3) My jsp contains the following code (this is just an example):
>
>    state = 
>    
>    true
>    false
>    
>
> 4) Here are the results in the browser:
>
> Struts ValueStack Debug
>
> Value Stack Contents ObjectProperty NameProperty Value
> com.rp.db.actions.Test update Update mapInstructions  servletContext
> org.apache.catalina.core.applicationcontextfac...@b79701 recordName
> servletResponse org.apache.catalina.connector.responsefac...@22e177 save
> Save locale en_US next Next state LIST cancel Cancel addContinent Add
> Continent add Add upload null actionErrors [] errors {} uploadMap Upload Map
> page 0 tableName  delete Delete command  uploadContentType null serv null
> addRegion Add Region sessinfo null uploadImage Upload Image texts null
> pageCount 0 errorMessages [] done Done edit Edit actionMessages [] pageSize
> 20 back Back httpSession
> org.apache.catalina.session.standardsessionfac...@15d45d9 init Init
> servletRequest org.apache.struts2.dispatcher.strutsrequestwrap...@a0a36 log
> org.apache.log4j.log...@e2b07b uploadFileName null fieldErrors {} pageTitle
> lastState NONE confirm Confirm Delete
> com.opensymphony.xwork2.DefaultTextProvider texts null
>
> Stack Context *These items are available using the #key notation*  KeyValue
> com.opensymphony.xwork2.dispatcher.HttpServletRequest
> org.apache.struts2.dispatcher.strutsrequestwrap...@a0a36
> com.opensymphony.xwork2.ActionContext.localeen_US
> com.opensymphony.xwork2.dispatcher.HttpServletResponse
> org.apache.catalina.connector.responsefac...@22e177
> com.opensymphony.xwork2.ActionContext.nameTest_init
> com.opensymphony.xwork2.ActionContext.application
> {org.apache.catalina.resources=org.apache.naming.resources.proxydircont...@10b23cf,
> org.apache.catalina.WELCOME_FILES=[Ljava.lang.String;@84f566,
> freemarker.configuration=freemarker.template.configurat...@12ea1dd,
> javax.servlet.context.tempdir=F:\development\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\work\Catalina\localhost\marmoset,
> org.apache.catalina.jsp_classpath=/F:/development/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/marmoset/WEB-INF/classes/;/F:/development/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/marmoset/WEB-INF/lib/commons-fileupload-1.2.1.jar;/F:/development/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/marmoset/WEB-INF/lib/commons-io-1.3.2.jar;/F:/development/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/marmoset/WEB-INF/lib/commons-logging-1.1.jar;/F:/development/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/marmoset/WEB-INF/lib/freemarker-2.3.13.jar;/F:/development/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/marmoset/WEB-INF/lib/javax.persistence_1.99.0.v200906021518.jar;/F:/development/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/marmoset/WEB-INF/lib/jenkov-butterfly-persistence-5.0.0.jar;/F:/development/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/marmoset/WEB-INF/lib/jstl-impl-1.2.jar;/F:/development/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/marmoset/WEB-INF/lib/junit-3.8.1.jar;/F:/development/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/marmoset/WEB-INF/lib/log4j-1.2.15.jar;/F:/development/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/marmoset/WEB-INF/lib/mysql-connector-java-5.1.7-bin.jar;/F:/development/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/marmoset/WEB-INF/lib/ognl-2.6.11.jar;/F:/development/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/marmoset/WEB-INF/lib/spring-test-2.5.6.jar;/F:/development/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/marmoset/WEB-INF/lib/standard.jar;/F:/development/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/marmoset/WEB-INF/lib/struts2-config-browser-plugin-2.1.6.jar;/F:/development/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/marmoset/WEB-INF/lib/struts2-core-2.1.6.jar;/F:/development/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/marmoset/WEB-INF/lib/tabletags-1.0.1.jar;/F:/development/workspace/.metadata/.plugins/o

How to access enum in jsp?

2009-09-06 Thread Bill Bohnenberger
How do I reference an enum variable in an  test attribute?
This is the situation, and the results I get:

1) I have a enum defined as

public enum ActionState
{
NONE, INIT, LIST, ADD, EDIT, DELETE ...
}

2) I have a variable of this type in my action class:

ActionState state;

3) My jsp contains the following code (this is just an example):

state = 

true
false


4) Here are the results in the browser:

Struts ValueStack Debug

Value Stack Contents ObjectProperty NameProperty Value
com.rp.db.actions.Test update Update mapInstructions  servletContext
org.apache.catalina.core.applicationcontextfac...@b79701 recordName
servletResponse org.apache.catalina.connector.responsefac...@22e177 save
Save locale en_US next Next state LIST cancel Cancel addContinent Add
Continent add Add upload null actionErrors [] errors {} uploadMap Upload Map
page 0 tableName  delete Delete command  uploadContentType null serv null
addRegion Add Region sessinfo null uploadImage Upload Image texts null
pageCount 0 errorMessages [] done Done edit Edit actionMessages [] pageSize
20 back Back httpSession
org.apache.catalina.session.standardsessionfac...@15d45d9 init Init
servletRequest org.apache.struts2.dispatcher.strutsrequestwrap...@a0a36 log
org.apache.log4j.log...@e2b07b uploadFileName null fieldErrors {} pageTitle
lastState NONE confirm Confirm Delete
com.opensymphony.xwork2.DefaultTextProvider texts null

Stack Context *These items are available using the #key notation*  KeyValue
com.opensymphony.xwork2.dispatcher.HttpServletRequest
org.apache.struts2.dispatcher.strutsrequestwrap...@a0a36
com.opensymphony.xwork2.ActionContext.localeen_US
com.opensymphony.xwork2.dispatcher.HttpServletResponse
org.apache.catalina.connector.responsefac...@22e177
com.opensymphony.xwork2.ActionContext.nameTest_init
com.opensymphony.xwork2.ActionContext.application
{org.apache.catalina.resources=org.apache.naming.resources.proxydircont...@10b23cf,
org.apache.catalina.WELCOME_FILES=[Ljava.lang.String;@84f566,
freemarker.configuration=freemarker.template.configurat...@12ea1dd,
javax.servlet.context.tempdir=F:\development\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\work\Catalina\localhost\marmoset,
org.apache.catalina.jsp_classpath=/F:/development/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/marmoset/WEB-INF/classes/;/F:/development/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/marmoset/WEB-INF/lib/commons-fileupload-1.2.1.jar;/F:/development/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/marmoset/WEB-INF/lib/commons-io-1.3.2.jar;/F:/development/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/marmoset/WEB-INF/lib/commons-logging-1.1.jar;/F:/development/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/marmoset/WEB-INF/lib/freemarker-2.3.13.jar;/F:/development/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/marmoset/WEB-INF/lib/javax.persistence_1.99.0.v200906021518.jar;/F:/development/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/marmoset/WEB-INF/lib/jenkov-butterfly-persistence-5.0.0.jar;/F:/development/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/marmoset/WEB-INF/lib/jstl-impl-1.2.jar;/F:/development/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/marmoset/WEB-INF/lib/junit-3.8.1.jar;/F:/development/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/marmoset/WEB-INF/lib/log4j-1.2.15.jar;/F:/development/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/marmoset/WEB-INF/lib/mysql-connector-java-5.1.7-bin.jar;/F:/development/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/marmoset/WEB-INF/lib/ognl-2.6.11.jar;/F:/development/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/marmoset/WEB-INF/lib/spring-test-2.5.6.jar;/F:/development/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/marmoset/WEB-INF/lib/standard.jar;/F:/development/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/marmoset/WEB-INF/lib/struts2-config-browser-plugin-2.1.6.jar;/F:/development/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/marmoset/WEB-INF/lib/struts2-core-2.1.6.jar;/F:/development/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/marmoset/WEB-INF/lib/tabletags-1.0.1.jar;/F:/development/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/marmoset/WEB-INF/lib/xwork-2.1.2.jar;/F:/development/Tomcat
5.5/common/classes/;/F:/development/Tomcat
5.5/common/i18n/tomcat-i18n-en.jar;/F:/development/Tomcat
5.5/common/i18n/tomcat-i18n-es.jar;/F:/development/Tomcat
5.5/common/i18n/tomcat-i18n-fr.jar;/F:/development/Tomcat
5.5/common/i18n/tomcat-i18n-ja.jar;/F:/development/Tomcat
5.5/common/lib/co

RE: List Iterator in JSP

2009-08-18 Thread Security Management
Duh, it's:



-Original Message-
From: Security Management [mailto:list-subscripti...@secmgmt.com] 
Sent: Tuesday, August 18, 2009 1:57 PM
To: 'Struts Users Mailing List'
Subject: List Iterator in JSP

My actions have a method, called getJavascriptIncludes() which returns a
List object.

I'm iterating like so, in the head:




</s:iterator>

Here's what's generated:

<script type="text/javascript" src="[/pages/getpic/js/getpic_lib.js,
com.secmgmt.struts2.actions.common.indexact...@4b7c69,
com.opensymphony.xwork2.defaulttextprovi...@658bbe]"

How do I get it to be just the first thing in that list?


-
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



List Iterator in JSP

2009-08-18 Thread Security Management
My actions have a method, called getJavascriptIncludes() which returns a
List object.

I'm iterating like so, in the head:






Here's what's generated: