Java Mailing List Archive

http://www.gg3721.com/

Home » Struts Users Mailing List »

user Digest 16 Dec 2009 07:30:33 -0000 Issue 8962

user-digest-help

2009-12-16


Author LoginPost Reply

user Digest 16 Dec 2009 07:30:33 -0000 Issue 8962

Topics (messages 204274 through 204294):

Re: ognl method lookup failure
 204274 by: Dale Newfield

Re: MySQL + JDBC
 204275 by: Todd Grigsby
 204279 by: Patrick J Kobly
 204284 by: Todd Grigsby
 204286 by: Patrick J Kobly
 204292 by: Todd Grigsby

Problem with jquery plugin
 204276 by: Oscar
 204293 by: Ernesto Reinaldo Barreiro
 204294 by: Johannes Geppert

Re: Unique Id creation
 204277 by: Todd Grigsby
 204280 by: Gabriel Belingueres
 204282 by: jayakumar ala
 204283 by: Patrick J Kobly
 204289 by: Lee Clemens

Trigger 2 actions
 204278 by: Jean-François Houzard

Anyone used jsTree with Struts2?
 204281 by: Michael Obster
 204287 by: Musachy Barroso
 204290 by: Michael Obster

s:autocompleter not working in IE7.
 204285 by: sharath karnati

How to forward....
 204288 by: Rafael Muneton

problem while reading multipart/form-data in struts
 204291 by: binash

Administrivia:

---------------------------------------------------------------------
To post to the list, e-mail: user@(protected)
To unsubscribe, e-mail: user-digest-unsubscribe@(protected)
For additional commands, e-mail: user-digest-help@(protected)

----------------------------------------------------------------------


Attachment: user_204274.ezm (zipped)
Musachy Barroso wrote:
> I would suggest

Thank you. After all my frustrations my bug was a typo in an EL
expression. Argh.

-Dale


Attachment: user_204275.ezm (zipped)


Other native apps. The Java apps are being migrated from a 32-bit
environment (WinXP and Java 32-bit + Struts 1.1), and they worked
there. I don't want to point to any one thing, since every part of the
equation is a newer version of what was there before, but at this point
the only things that can't use the connections are the web apps. Have
you tried an all 64-bit setup with ODBC?

TG

Patrick J Kobly wrote:
> Do you have other Java apps working, or just other native apps?
>
> PK
>
> Todd Grigsby wrote:
>>
>>
>> It's all 64-bit, installed correctly enough to work from other apps.
>> I will try the Sun forums.
>>
>> TG
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>



Attachment: user_204279.ezm (zipped)
Todd Grigsby wrote:
> Other native apps. The Java apps are being migrated from a 32-bit
> environment (WinXP and Java 32-bit + Struts 1.1), and they worked
> there. I don't want to point to any one thing, since every part of
> the equation is a newer version of what was there before, but at this
> point the only things that can't use the connections are the web apps.
But the web apps are the only things that use Java. You don't have
standalone Java apps or Java webapps built on a different framework than
Struts... The issue is almost certainly a 32-bit JRE trying to access a
64-bit ODBC driver.
> Have you tried an all 64-bit setup with ODBC?
Nope. Have never had a need for ODBC. Though I can sorta see its
advantages in a mixed-language environment.
> TG
PK



Attachment: user_204284.ezm (zipped)


Patrick J Kobly wrote:
> Todd Grigsby wrote:
>> Other native apps. The Java apps are being migrated from a 32-bit
>> environment (WinXP and Java 32-bit + Struts 1.1), and they worked
>> there. I don't want to point to any one thing, since every part of
>> the equation is a newer version of what was there before, but at this
>> point the only things that can't use the connections are the web apps.
> But the web apps are the only things that use Java. You don't have
> standalone Java apps or Java webapps built on a different framework
> than Struts... The issue is almost certainly a 32-bit JRE trying to
> access a 64-bit ODBC driver.

I'll buy that, but I'm confused -- I installed 64-bit Java, and when I
open a command prompt and do "java -version", it identifies itself as:

  Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
  Java HotSpot(TM) 64-Bit Server VM (build 14.2-b01, mixed mode)

But I'll see if I have anything on my system that is getting loaded
that's 32-bit.

Thanks!

TG



Attachment: user_204286.ezm (zipped)
Running the binary dist of Tomcat?

tomcat.exe / tomcatw.exe

PK

Todd Grigsby wrote:
>
>
> Patrick J Kobly wrote:
>> Todd Grigsby wrote:
>>> Other native apps. The Java apps are being migrated from a 32-bit
>>> environment (WinXP and Java 32-bit + Struts 1.1), and they worked
>>> there. I don't want to point to any one thing, since every part of
>>> the equation is a newer version of what was there before, but at
>>> this point the only things that can't use the connections are the
>>> web apps.
>> But the web apps are the only things that use Java. You don't have
>> standalone Java apps or Java webapps built on a different framework
>> than Struts... The issue is almost certainly a 32-bit JRE trying to
>> access a 64-bit ODBC driver.
>
> I'll buy that, but I'm confused -- I installed 64-bit Java, and when I
> open a command prompt and do "java -version", it identifies itself as:
>
>   Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
>   Java HotSpot(TM) 64-Bit Server VM (build 14.2-b01, mixed mode)
>
> But I'll see if I have anything on my system that is getting loaded
> that's 32-bit.
>
> Thanks!
>
> TG
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>



Attachment: user_204292.ezm (zipped)


Yes. Running Tomcat 6 as a Windows service...   Ok, this is
interesting. On a whim, I ran tomcat6w, and when it came up, it appears
to using the "C:\Program Files (x86)\Java\jre6\bin\client\jvm.dll",
which implies to me that the JVM it's attempting to use is the 32-bit
version.

High five, Mr. Kobly.

I searched around and, under C:\Program Files, I found a couple of
jvm.dll's. I tried pointing Tomcat to each of them, but the service
died with an error code of #1. Not sure what that is, but it occurs to
me that I might fix this by simply reinstalling Tomcat and, when it asks
for a JRE, I'll point it to the other JVM DLLs and see what it does.

TG

Patrick J Kobly wrote:
> Running the binary dist of Tomcat?
>
> tomcat.exe / tomcatw.exe
>
> PK
>
> Todd Grigsby wrote:
>>
>>
>> Patrick J Kobly wrote:
>>> Todd Grigsby wrote:
>>>> Other native apps. The Java apps are being migrated from a 32-bit
>>>> environment (WinXP and Java 32-bit + Struts 1.1), and they worked
>>>> there. I don't want to point to any one thing, since every part of
>>>> the equation is a newer version of what was there before, but at
>>>> this point the only things that can't use the connections are the
>>>> web apps.
>>> But the web apps are the only things that use Java. You don't have
>>> standalone Java apps or Java webapps built on a different framework
>>> than Struts... The issue is almost certainly a 32-bit JRE trying to
>>> access a 64-bit ODBC driver.
>>
>> I'll buy that, but I'm confused -- I installed 64-bit Java, and when
>> I open a command prompt and do "java -version", it identifies itself as:
>>
>>   Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
>>   Java HotSpot(TM) 64-Bit Server VM (build 14.2-b01, mixed mode)
>>
>> But I'll see if I have anything on my system that is getting loaded
>> that's 32-bit.
>>
>> Thanks!
>>
>> TG
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>



Attachment: user_204276.ezm (zipped)
Hi to all, i was exploring the jquery plugin of struts 2 because i read
that you can do something like a grid with the tags that provides that
plugin, something like displaytag or extremecomponents.

I follow an example that i found where they simply create a list in
action and show the data in the jsp with the grid tags, but i have a
problem, when i call the action, the method execute is called normally
but finally it "downloads" the action, appears a dialog box in my
browser asking if i want to save or open the file someAction.action. I'm
using a json result, this is my struts.xml:

<package name="default" extends="struts-default,json-default" >
    <action class="com.datasoft.struts.actions.JsonTable"
name="jsontable">
       <result name="success" type="json">/tablaYeison.jsp</result>
    </action>
  </package>

And this is the link with i'm trying to call the action:

<a href="jsontable.action">Show me the data</a>

I think that is something about the result.

Regards.


Attachment: user_204293.ezm (zipped)
I'm using jqGrid this way

http://code.google.com/p/antilia-struts/wiki/SearchPage

<http://code.google.com/p/antilia-struts/wiki/SearchPage>Regards,

Ernesto

On Tue, Dec 15, 2009 at 8:57 PM, Oscar <oscar.kalderon@(protected):

> Hi to all, i was exploring the jquery plugin of struts 2 because i read
> that you can do something like a grid with the tags that provides that
> plugin, something like displaytag or extremecomponents.
>
> I follow an example that i found where they simply create a list in action
> and show the data in the jsp with the grid tags, but i have a problem, when
> i call the action, the method execute is called normally but finally it
> "downloads" the action, appears a dialog box in my browser asking if i want
> to save or open the file someAction.action. I'm using a json result, this is
> my struts.xml:
>
> <package name="default" extends="struts-default,json-default" >
>     <action class="com.datasoft.struts.actions.JsonTable"
> name="jsontable">
>       <result name="success" type="json">/tablaYeison.jsp</result>
>     </action>
>  </package>
>
> And this is the link with i'm trying to call the action:
>
> <a href="jsontable.action">Show me the data</a>
>
> I think that is something about the result.
>
> Regards.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment: user_204294.ezm (zipped)

You only link the JSON Result so your Browser download it,
instead of work with the result.

jsontable.action Show me the data

Give this url to the GRID ike this example.

  <s:url id="remoteurl" action="jsontable"/>
  <sj:grid
    href="%{remoteurl}"
    id="gridtable"
    caption="Customer Examples"
    dataType="json"
    pager="true"
    gridModel="gridModel"
    rowList="10,15,20"
    rowNum="15"
    rownumbers="true"
  >
    <sj:gridColumn name="id" index="id" title="ID" formatter="integer"
sortable="false"/>
    <sj:gridColumn name="name" index="name" title="Name"
sortable="true"/>
    <sj:gridColumn name="country" index="country" title="Country"
sortable="false"/>
    <sj:gridColumn name="city" index="city" title="City"
sortable="false"/>
    <sj:gridColumn name="creditLimit" index="creditLimit" title="Credit
Limit" formatter="currency" sortable="false"/>
  </sj:grid>




Oscar Calderón-2 wrote:
>
> Hi to all, i was exploring the jquery plugin of struts 2 because i read
> that you can do something like a grid with the tags that provides that
> plugin, something like displaytag or extremecomponents.
>
> I follow an example that i found where they simply create a list in
> action and show the data in the jsp with the grid tags, but i have a
> problem, when i call the action, the method execute is called normally
> but finally it "downloads" the action, appears a dialog box in my
> browser asking if i want to save or open the file someAction.action. I'm
> using a json result, this is my struts.xml:
>
> <package name="default" extends="struts-default,json-default" >
>      <action class="com.datasoft.struts.actions.JsonTable"
> name="jsontable">
>         <result name="success" type="json">/tablaYeison.jsp</result>
>      </action>
>   </package>
>
> And this is the link with i'm trying to call the action:
>
> jsontable.action Show me the data
>
> I think that is something about the result.
>
> Regards.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>


-----
---
web: http://www.jgeppert.com
twitter: http://twitter.com/jogep

--
Sent from the Struts - User mailing list archive at Nabble.com.



Attachment: user_204277.ezm (zipped)
jayakumar ala wrote:
> Hi All,
> I am using struts2 in my web application.
> Which is the best way to create unique Id for each file upload i do in my
> application...?
>
> Thanks
> Ala
>
>  

I've always used the original filename with a time stamp, down to the
millisecond formatted with leading zeros and without separators,
appended to the end. If a create fails, I wait a few milliseconds and
regenerate the filename. The nice part about the time stamp is that you
have the date and time the file was uploaded in the name itself.

TG


Attachment: user_204280.ezm (zipped)
I use File.createTempFile:

http://java.sun.com/j2se/1.5.0/docs/api/java/io/File.html#createTempFile(java.lang.String,%20java.lang.String,%20java.io.File)

Then I relate the uploaded filename with the saved temp file name in a
database table.

Gabriel

2009/12/15 Todd Grigsby <strutsuser@(protected)>:
> jayakumar ala wrote:
>>
>> Hi All,
>>  I am using struts2 in my web application.
>>  Which is the best way to create unique Id for each file upload i do in my
>> application...?
>>
>> Thanks
>> Ala
>>
>>
>
> I've always used the original filename with a time stamp, down to the
> millisecond formatted with leading zeros and without separators, appended to
> the end.  If a create fails, I wait a few milliseconds and regenerate the
> filename.  The nice part about the time stamp is that you have the date and
> time the file was uploaded in the name itself.
>
> TG
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>


Attachment: user_204282.ezm (zipped)
I am trying to upload multiple files in my application , So i am looking for
different approach to create unique Id for all the uploaded files. Any
suggestions are appreciated.



On Tue, Dec 15, 2009 at 1:54 PM, Gabriel Belingueres
<belingueres@(protected):

> I use File.createTempFile:
>
>
> http://java.sun.com/j2se/1.5.0/docs/api/java/io/File.html#createTempFile(java.lang.String,%20java.lang.String,%20java.io.File)
>
> Then I relate the uploaded filename with the saved temp file name in a
> database table.
>
> Gabriel
>
> 2009/12/15 Todd Grigsby <strutsuser@(protected)>:
> > jayakumar ala wrote:
> >>
> >> Hi All,
> >> I am using struts2 in my web application.
> >> Which is the best way to create unique Id for each file upload i do in
> my
> >> application...?
> >>
> >> Thanks
> >> Ala
> >>
> >>
> >
> > I've always used the original filename with a time stamp, down to the
> > millisecond formatted with leading zeros and without separators, appended
> to
> > the end. If a create fails, I wait a few milliseconds and regenerate the
> > filename. The nice part about the time stamp is that you have the date
> and
> > time the file was uploaded in the name itself.
> >
> > TG
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > For additional commands, e-mail: user-help@(protected)
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment: user_204283.ezm (zipped)
java.util.UUID.randomUUID() ?

http://java.sun.com/j2se/1.5.0/docs/api/java/util/UUID.htm

PK

jayakumar ala wrote:
> I am trying to upload multiple files in my application , So i am looking for
> different approach to create unique Id for all the uploaded files. Any
> suggestions are appreciated.
>
>
>
> On Tue, Dec 15, 2009 at 1:54 PM, Gabriel Belingueres
> <belingueres@(protected):
>
>  
>> I use File.createTempFile:
>>
>>
>> http://java.sun.com/j2se/1.5.0/docs/api/java/io/File.html#createTempFile(java.lang.String,%20java.lang.String,%20java.io.File)
>>
>> Then I relate the uploaded filename with the saved temp file name in a
>> database table.
>>
>> Gabriel
>>
>> 2009/12/15 Todd Grigsby <strutsuser@(protected)>:
>> > jayakumar ala wrote:
>>  
>>>> Hi All,
>>>> I am using struts2 in my web application.
>>>> Which is the best way to create unique Id for each file upload i do in
>>>>      
>> my
>>  
>>>> application...?
>>>>
>>>> Thanks
>>>> Ala
>>>>
>>>>
>>>>      
>>> I've always used the original filename with a time stamp, down to the
>>> millisecond formatted with leading zeros and without separators, appended
>>>    
>> to
>>  
>>> the end. If a create fails, I wait a few milliseconds and regenerate the
>>> filename. The nice part about the time stamp is that you have the date
>>>    
>> and
>>  
>>> time the file was uploaded in the name itself.
>>>
>>> TG
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>>> For additional commands, e-mail: user-help@(protected)
>>>
>>>
>>>    
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>>  
>
>  


Attachment: user_204289.ezm (zipped)
OP: What Struts tag are you using to upload multiple files at the same time?
I may be wrong, but I didn't know this was possible with Struts.  If so,
what filename are they given by default? I use file upload tags but they are
saved as default-named files I can access via the File setter in my Action
(file.getAbsolutePath()).

Otherwise, I would suggest going with a solution along the line of PK's
solution with UUID (probably best with the ms timestamp) as part of the file
name or using SecureRandom.nextInt and Integer.MAX_VALUE.

To be extra safe, you could have a static Set to maintain all file names and
ensure it not is contained in that Set before creating it (and populate the
Set during initialization).


TG, Out of curiosity, why would the current milliseconds past epoch need to
be zero-padded? (besides code written for ~277 years from now, when it still
likely wouldn't matter?)

-----Original Message-----
From: Todd Grigsby [mailto:strutsuser@(protected)]
Sent: Tuesday, December 15, 2009 3:02 PM
To: Struts Users Mailing List
Subject: Re: Unique Id creation

jayakumar ala wrote:
> Hi All,
> I am using struts2 in my web application.
> Which is the best way to create unique Id for each file upload i do in my
> application...?
>
> Thanks
> Ala
>
>  

I've always used the original filename with a time stamp, down to the
millisecond formatted with leading zeros and without separators,
appended to the end. If a create fails, I wait a few milliseconds and
regenerate the filename. The nice part about the time stamp is that you
have the date and time the file was uploaded in the name itself.

TG

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)





Attachment: user_204278.ezm (zipped)
Hello, I'm new with Struts 2.
I'm actually using Struts 2 with the struts-dojo-tags.

Consider the following situation.
I would like to submit a form and to associate two distinct actions to
the form, for exemple MyAction1 and MyAction2. And I would like that
MyAction1 refresh the MyRes1 div and that MyAction2 refresh the MyRes2
div.

How can I do that?
Thank you :)

Not working code example
--------------------------------------

<s:form namespace="/mynamespace" action="MyAction1, MyAction2"
targets="MyRes1, MyRes2">
<input type="text" name="data">
<sx:submit />
</s:form>

<s:div id="MyRes1"/>
<s:div id="MyRes2"/>


Attachment: user_204281.ezm (zipped)
Hi,

is there anyone who has used jsTree in a struts2 application? Having
some problems using he component. First I don't get a JSON format
generated with struts2 which the tree understands and the 2nd try is
not even better where I changed from a JSON to XML-Code. The tree
works with that but only on non-IE browsers :-(. IE have some problems
with XML and the used Sarissa lib...

So if anyone knows a good alternative with a similiar format (xml is
preferred), please tell me.

Regards,
Michael


Attachment: user_204287.ezm (zipped)
On Tue, Dec 15, 2009 at 1:20 PM, Michael Obster <michael@(protected):
> jsTree

I used it with the JSON plugin many moons ago, what problem are you having?


Attachment: user_204290.ezm (zipped)
Musachy Barroso schrieb:
> On Tue, Dec 15, 2009 at 1:20 PM, Michael Obster <michael@(protected):
>> jsTree
>
> I used it with the JSON plugin many moons ago, what problem are you having?
>

First of all I get no tree displayed. After looking into the generated
JSON I see, that die variable names are quoted with "-quotes. Perhaps
this confuses the jsTree. The second problem are escaped characters like
"/" with are escaped as "\/" in the JSON.

I'm wrinting the generated JSON string into a string variable of a
json-generating action class.

How do you create a JSON with that format:
[
 { attributes: { id : "pjson_1" },
           data: "Root node 1",
 },
 { attributes: { id : "pjson_5" },
           data: "Root node 2" }
]


I always getting s.th like this:
"myvariable" : [
 { "attributes": { "id" : "pjson_1" },
           "data": "Root node 1",
 },
 { "attributes": { "id" : "pjson_5" },
           "data": "Root node 2" }
]

The corresponding class looks like
public AjaxAction implements ActionSupport {

private String myvariable;

public String execute() throws Exception {
 JSTreeDataBuilder jsTreeDataBuilder = new JSTreeDataBuilder(new
  ComputerNodeProvider(computer));
 jsTreeDataBuilder.assembleJSON();

 myvariable = jsTreeDataBuilder.getJSON();

 return Action.SUCCESS;
}

public String getMyvariable() {
 return data;
}

public void setMyvariable(String data) {
 this.myvariable = myvariable;
}

}

So the point is, it doesn't work and I don't know how to fix it.

Kind regards,
Michael


Attachment: user_204285.ezm (zipped)
Hi All,
 
   I'm trying s:autocompleter with below code
 
autocompleter.jsp file
 
<%@(protected)" %>

<html>
<head>
<title>Struts 2 Autocompleter Example!</title>
<s:head theme="ajax" />
</head>
<body>

<table cellpadding="0" cellspacing="5" width="95%">
<tr>
<td>
<b>Search Carrier:&nbsp;</b>
<!-- <s:textfield key="search_carrier" size="50" maxlength="100" /> -->
<s:url id="carrierList" action="AutocompleteField" method="searchAutoCarrier" />
<s:autocompleter name="search_carrier" theme="ajax" href="%{carrierList}" showDownArrow="false" dropdownWidth="300" dropdownHeight="500" loadOnTextChange="true"/>
</td>
</tr>
</table>

</body>
</html>
------------------------------------------------------------------------------
AutoCompleteAction.java having
//Implemented for auto completer
public String searchAutoCarrier() throws Exception{
logger.info("Inside searchAutoCarrier method: "+search_carrier);
try{
//setServe_carriers(manageFormService.getServeDetails(complaint_key));
json = new HashMap<String,String>();

if(null!=search_carrier && search_carrier.trim().length()>2){
json.put("AB","Alabama");
json.put("AL","Alaska");
json.put("AR","Arizona");
json.put("AK","Arkansas");
json.put("CA","California");
json.put("CO","Colorado");
json.put("CN","Connecticut");
json.put("DL","Delaware");
json.put("DC","District of Columbia");
json.put("FL","Florida");
json.put("GE","Georgia");
json.put("HA","Hawaii");
json.put("ID","Idaho");
json.put("IL","Illinois");
json.put("IN","Indiana");
logger.info("Inside searchAutoCarrier method json size: "+json.size());
//setCarriers(results);
   if(json.size()<1){
     addActionError(getText("search_carrier_error"));
   }
}
else{
   addActionError(getText("search_carrier_invalid"));
  }
}
catch (Exception e) {
logger.error("Exception in searchAutoCarrier: "+e.toString());
throw new Exception();
}

return SUCCESS;
}//End of searchAutoCarrier method
 
 
private Map<String,String> json;

public Map<String, String> getJson() {
return json;
}

public void setJson(Map<String, String> json) {
this.json = json;
}
 
--------------------------------
 
In stuts.xml file
 
<action name="AutocompleteField!*" class="com.action.AutocompleteAction" method="{1}">
<result type="json"><param name="root">json</param></result>
</action>

<action name="autocompleter" class="com.action.AutocompleteAction">
<result>/pages/autocompleter.jsp</result>
</action>
 
 
  In IE ,when I enter 'ala' it needs to display list of values which are starting with these values but it is sending request to action but not displaying list of values in dropdown. I checked this request with logger statement.
 
  The same code is working fine in Firefox browser(displaying list of values starting with ala).
 
  I'm using struts2-core-2.0.11.jar and added jsonplugin-0[1].30.jar file.
 
  In struts package level added json-default.
 
<package name="app" extends="struts-default,json-default">
 
  Can anyone please let me know why this is not working in  IE and how to fix this problem. I'm not even getting any javascript errors.
 
  Thanks in advance.
 
Regards,
Sharath Karnati.
 
 



Attachment: user_204288.ezm (zipped)

Hello:



I am trying to develop a small application that contains a Login.jsp, in case of failure the controller must redirect to Login.jsp again;  in case of success the controller must redirect to a Java application ,MainMenu.class.



I think this is done in struts-config.xml file:



<?xml version="1.0" encoding="ISO-8859-1" ?>

<!DOCTYPE struts-config PUBLIC

"-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"

"http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">

<!-- This is the Struts configuration file for the Login example application -->

<struts-config>

<!-- ========== Data Source Definitions ================================ -->

<!-- ========== Form Bean Definitions ================================== -->

<form-beans>

<form-bean name="loginForm"

type="jhtp5.jsp.LoginForm"/>

</form-beans>



<!-- ========== Action Mapping Definitions ============================= -->

<action-mappings>

<action path="/login"

type="jhtp5.jsp.LoginAction"

name="loginForm"

scope="request"

input="/login.jsp"

validate="true">

<forward name="failure" path="/login.jsp"/>

<forward name="success" path="/MainMenu.class"/>

</action>

</action-mappings>

<!-- ========== Message Resources Definitions ========================== -->

<message-resources null="false"

parameter="ApplicationResources"/>

</struts-config>



Is this OK??????

What is the right way to do it????

Any help is welcome.



Vangelis
           
_________________________________________________________________
Windows Live: Make it easier for your friends to see what you’re up to on Facebook.
http://www.microsoft.com/middleeast/windows/windowslive/see-it-in-action/social-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:en-xm:SI_SB_2:092009

Attachment: user_204291.ezm (zipped)

We are using a validation framework to validate all input to our application.
This is implemented with a filter. In order to handle multipart form data
twice, we have created BufferedRequestWrapper class (as a sub class
'HttpServletRequestWrapper'). Now with this class I am able to get all the
form bean values in both filter class as well as in the struts ActionForms.
After saving the form data, i am redirecting the request to a jsp page which
includes global header page. In this included page i am getting following
error

java.lang.IllegalArgumentException: Cannot invoke Form.setCompanyLogo -
argument type mismatch.

In this page Struts try to populate(set methods) the form bean instead of
calling get methods. Here above exceptions is thrown in PropertiesUtil's
invoke method. please help to solve this problem. (we are not getting the
error if we pass Request objet instead of Wrapper object. in that case we
wont be able to get form data twice)

Wrapper class used is

public class BufferedRequestWrapper extends HttpServletRequestWrapper {

  /**
  * The variable holds the Log4j instance to log the INFO, DEBUG, ERROR
and FATAL events.
  */
  private static Logger LOG =
Logger.getLogger(BufferedRequestWrapper.class.getName());

  ByteArrayInputStream bais;
  ByteArrayOutputStream baos;
  BufferedServletInputStream bsis;
  byte[] buffer;
  HttpServletRequest request =null;
 
  public HttpServletRequest getHTTPRequest(){
    return request;
  }
 

  public BufferedRequestWrapper(HttpServletRequest req) throws IOException
{
    super(req);
    this.request = req;
    // Read InputStream and store its content in a buffer.
    InputStream is = req.getInputStream();
    baos = new ByteArrayOutputStream();
    byte buf[] = new byte[1024];
    int letti;
    while ((letti = is.read(buf)) > 0)
       baos.write(buf, 0, letti);
    buffer = baos.toByteArray();
  }

  public ServletInputStream getInputStream() {
    try {
       // Generate a new InputStream by stored buffer
       bais = new ByteArrayInputStream(buffer);
       // Istantiate a subclass of ServletInputStream
       // (Only ServletInputStream or subclasses of it are accepted by
the
       // servlet engine!)
       bsis = new BufferedServletInputStream(bais);
    } catch (Exception ex) {
       ex.printStackTrace();
    } finally {
       return bsis;
    }
  }

   
}

following code is there in filter

if(request.getHeader(CONTENT_TYPE)!=null && isMultiPart() // checks if req
is multipart
          bufferedRequest = new BufferedRequestWrapper(request);
          //validate the input.
          Validator.validate(bufferedRequest);
          fc.doFilter(bufferedRequest, res);
        } else { // for normal request
          //validate the input.
          Validator.validate(request);
          fc.doFilter(req, res);
        }


exception thrown in jSP page is (this jsp page is part of view page after
the execution action class which handles form data)

19:49:22,785 ERROR [PropertyUtils] Method invocation failed.
java.lang.IllegalArgumentException: argument type mismatch
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.apache.commons.beanutils.PropertyUtilsBean.invokeMethod (PropertyUtilsBean.java:1773)
at
org.apache.commons.beanutils.PropertyUtilsBean.setSimpleProperty (PropertyUtilsBean.java:1759)
at
org.apache.commons.beanutils.PropertyUtilsBean.setNestedProperty (PropertyUtilsBean.java:1648)
at
org.apache.commons.beanutils.PropertyUtilsBean.setProperty (PropertyUtilsBean.java:1677)
at
org.apache.commons.beanutils.BeanUtilsBean.setProperty (BeanUtilsBean.java:1022)
at
org.apache.commons.beanutils.BeanUtilsBean.populate (BeanUtilsBean.java:811)
--
Sent from the Struts - User mailing list archive at Nabble.com.


©2008 gg3721.com - Jax Systems, LLC, U.S.A.