Java Mailing List Archive

http://www.gg3721.com/

Home » Struts Users Mailing List »

user Digest 21 Apr 2012 16:43:04 -0000 Issue 9591

user-digest-help

2012-04-21


Author LoginPost Reply

user Digest 21 Apr 2012 16:43:04 -0000 Issue 9591

Topics (messages 212742 through 212752)

Re: No result defined for action com.xx.xxx.admin.action.AdminAction and result input
 212742 by: Łukasz Lenart
 212743 by: Hernán

Re: Behavior of <s:param> tags with date values
 212744 by: Scott Williams
 212745 by: Łukasz Lenart

Struts 2 Plugin for Netbeans
 212746 by: rob stone
 212747 by: Łukasz Lenart
 212749 by: Frans Thamura
 212750 by: Christian Grobmeier
 212751 by: Maurizio Cucchiara

Re: Authentication and authorization
 212748 by: M. Rakowski

Request is not coming into Struts2 action method while running in Weblogic 10.3.4
 212752 by: Rout, Biswajit

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_212742.eml (zipped)
2012/4/19 Rout, Biswajit <biswajit.rout@(protected)>:
> No result defined for action com.xx.xxx.admin.action.AdminAction and result input

Because there is no result configured for adminProcess.action (it's empty).

Anyway, revise your architecture, read some docs about Ajax, JSON,
Struts2 because you overdo a lot too much :/

And send your questions to user@(protected) ->
http://struts.apache.org/mail.html , sending them around the world
will not help you.


Regards
--
Łukasz http://www.lenart.org.pl/
mobile +48 606 323 122, office +27 11 0838747
Warszawa JUG conference - Confitura http://confitura.pl/


Attachment: user_212743.eml (zipped)
Hello there! Your action should return a String like "list" or "success" or
just "something" and then in your struts.xml file, you should add a snippet
in your action for that string. Thus, the framework will be able to render
a result. Your action is returning null, and you haven't defined a result
either. In your action instead of
return null;
use
return "success";

And in your struts.xml inside your action add:

       <result name="success" type="dispatcher">
          <param name="location">/WEB-INF/jsp/admin.jsp</param>
       </result>



On Thu, Apr 19, 2012 at 1:01 PM, Rout, Biswajit <biswajit.rout@(protected):

> Hi All,
>
> If you will look into the below attached files, from the welcome page
> (index.jsp) it is going to admin.html (based on my struts.xml). Internally
> admin.html is calling admin.js and from my admin.js to fill combo box I am
> calling adminProcess.action. In that way I will be able to fill up the
> combo box.
>
> For this reason, intentionally my action method returning null.
>
> However, I am getting below exception
> No result defined for action com.xx.xxx.admin.action.AdminAction and
> result input
>
>
> Please find the list of files:
>
> Admin.js
>
>     var crudComboStore = new Ext.data.JsonStore({
>           storeId: 'table_list',
>           proxy : {
>                type :'ajax',
>                url : 'adminProcess.action',
>                reader : {
>                     type :'json',
>                root : 'crudData'
>             }
>           },
>     fields : ['tablename', 'displayName']
>
>     });
>     crudComboStore.load();
>
>
> Index.jsp
>
> <%@(protected)"
>     pageEncoding="ISO-8859-1"%>
> <%@(protected)"%>
> <html>
> <head>
> <title>Admin Page</title>
> </head>
> <body>
> <h3>Admin Page</h3>
> <s:a href="jsonAction.action">
>     <FONT color="green">Go to Admin Page..</FONT>
> </s:a>
> </body>
> </html>
>
> admin.html
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "
> http://www.w3.org/TR/html4/strict.dtd">
> <html>
> <head>
> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />
> <title>Admin Page</title>
>
> <link rel="stylesheet" type="text/css"
>     href="extjs/resources/css/ext-all.css">
> <script type="text/javascript" src="extjs/bootstrap.js"></script>
> <script type="text/javascript" src="admin/admin.js"></script>
>
> </head>
> <body></body>
> </html>
>
> struts.xml
>
>           <action name="jsonAction"
> class="com.xx.xxx.admin.action.CRUDAction">
>                <result>admin/admin.html</result>
>           </action>
>
>           <action name="adminProcess" method="getMasterTableList"
>                class="com.xx.xxx.admin.action.AdminAction">
>           </action>
>
> My action method
>
>     public String getMasterTableList() {
>           System.out.println("AdminAction.getMasterTableList @@@@@");
>
>           List<CRUDSVO> objCRUDTableList = null;
>           Iterator<CRUDSVO> objItr = null;
>           CRUDSVO objCRUDSVO = null;
>
>           JSONObject interfaceObject = new JSONObject();
>           JSONArray interfaceArray = new JSONArray();
>           JSONObject finalInterfaceObject = new JSONObject();
>
>           try {
>                //HttpServletResponse response =
> ServletActionContext.getResponse();
>                objCRUDTableList = adminBo.getCRUDTableList();
>                objItr = objCRUDTableList.iterator();
>                while (objItr.hasNext()) {
>                     objCRUDSVO = null;
>                     objCRUDSVO = objItr.next();
>                     interfaceObject = new JSONObject();
>
> interfaceObject.put(AdminConstants.TABLE_NAME, objCRUDSVO.getTableName());
>
> interfaceObject.put(AdminConstants.DISPLAY_NAME,
> objCRUDSVO.gettableDisplayName());
>                     interfaceArray.put(interfaceObject);
>                }
>                finalInterfaceObject.put(AdminConstants.CRUD_DATA,
> interfaceArray);
>
> response.getWriter().write(finalInterfaceObject.toString());
>           } catch (IOException e) {
>                e.printStackTrace();
>           } catch (Exception ex) {
>                ex.printStackTrace();
>           }
>           return null;
>     }
>
> Thanks in advance for helping me.
>
>
>
> Best regards,
> Biswajit
> Planned Vacation : From 2-July-2012 to 6-July-2012
>
>


--
Hernán

Attachment: user_212744.eml (zipped)
Thanks Dave.

After reading your email I tried your solution, outputting the date in the tag body rather than using the value attribute. I was surprised to find the <s:param> tag behaves the way it does with Date objects, invoking toString(). Given the behavior of the Date type conversion class, I assumed param would output Date values in a compatible date format.

Many thanks,

Scott

--- On Fri, 4/13/12, Dave Newton <davelnewton@(protected):

> From: Dave Newton <davelnewton@(protected)>
> Subject: Re: Behavior of <s:param> tags with date values
> To: "Struts Users Mailing List" <user@(protected)>
> Date: Friday, April 13, 2012, 1:05 PM
> I'd think it'd just use the default
> toString(), but I could be (badly)
> mistaken.
>
> IMO you'd want to format it in the body of a wrapping
> <s:param> tag.
>
> Dave
>
> On Fri, Apr 13, 2012 at 12:50 PM, Scott Williams
> <scottfwilliams@(protected):
>
> > Hi:
> >
> > I am experiencing some unexpected behavior with the
> Struts2 <s:param> tag
> > when using it with date values. When I try to use an
> <s:param> tag within
> > <s:url> to pass a date argument, the date is not
> output in the
> > DateFormat.SHORT format, resulting in a type conversion
> error on submission.
> >
> > For example, these  struts tags:
> >
> > <s:url id="anchorUrl" namespace="/experiment"
> action="go" escapeAmp="true">
> >  <s:param name="inDate" value="inDate"/>
> > </s:url>
> > <s:a href="%{anchorUrl}" id="go">Click this
> here...</s:a>
> >
> > produce this output:
> >
> > <a id="go"
> >
> href="/EXP/experiment/go.action?inDate=Thu+Apr+12+21%3A52%3A30+EDT+2012">Click
> > this here...</a>
> >
> > With HTML escaping removed, the result is "Fri Apr 13
> 12:31:00 EDT 2012",
> > a format that nests the time inside the date.
> >
> > Unsurprisingly, this is causing a type conversion error
> when submitted to
> > the Action class. I'm perplexed -- could I be
> misunderstanding the tags'
> > usage, and this the expected behavior? Or might this be
> a bug, perhaps?
> >
> > Many thanks,
> >
> > Scott Williams
> >
> >
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > For additional commands, e-mail: user-help@(protected)
> >
> >
>


Attachment: user_212745.eml (zipped)
2012/4/19 Scott Williams <scottfwilliams@(protected)>:
> After reading your email I tried your solution, outputting the date in the tag body rather than using the value attribute. I was surprised to find the <s:param> tag behaves the way it does with Date objects, invoking toString(). Given the behavior of the Date type conversion class, I assumed param would output Date values in a compatible date format.

Register an issue if you want, but please attache an use case how to
reproduce the behaviour ;-)


Kind regards
--
Łukasz http://www.lenart.org.pl/
mobile +48 606 323 122, office +27 11 0838747
Warszawa JUG conference - Confitura http://confitura.pl/


Attachment: user_212746.eml (zipped)
Hello,

I am trying to incorporate the Struts 2 plug-in into the Netbeans IDE
and having problems. The Netbeans version is 7.0.1 which is the latest
available for Debian.

One suggested fix was to compile the plug-in source using 7.0.1 to
achieve this, but that too failed as obviously I am missing some
directory in a build.xml or build-imp.xml file.

Inspecting some of the source files reveals lines ending with ^M which
would seem to indicate that development of the plug-in did not occur on
a Linux platform.

So, if anybody has successfully installed the Struts 2 plug-in on
version 7.0.1 of Netbeans under a Linux environment, could you please
help me by telling me exactly "how" you did it.

Regards,
Robert



Attachment: user_212747.eml (zipped)
2012/4/19 rob stone <floriparob@(protected)>:
> I am trying to incorporate the Struts 2 plug-in into the Netbeans IDE
> and having problems. The Netbeans version is 7.0.1 which is the latest
> available for Debian.

Use IntelliJ IDEA, give up with NB ;-)


Kind regards
--
Łukasz http://www.lenart.org.pl/
mobile +48 606 323 122, office +27 11 0838747
Warszawa JUG conference - Confitura http://confitura.pl/


Attachment: user_212749.eml (zipped)
as a eclipse user. :) any idea?


F

On Fri, Apr 20, 2012 at 1:19 AM, Łukasz Lenart <lukasz.lenart@(protected)
> wrote:

> 2012/4/19 rob stone <floriparob@(protected)>:
> > I am trying to incorporate the Struts 2 plug-in into the Netbeans IDE
> > and having problems. The Netbeans version is 7.0.1 which is the latest
> > available for Debian.
>
> Use IntelliJ IDEA, give up with NB ;-)
>
>
> Kind regards
> --
> Łukasz http://www.lenart.org.pl/
> mobile +48 606 323 122, office +27 11 0838747
> Warszawa JUG conference - Confitura http://confitura.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment: user_212750.eml (zipped)
I have tried Eclipse and Netbeans and finally found out that life is
so freaking easy with IntelliJ and the Struts 2 plugin.
I could not believe it first, because it was the Struts-guys who
recommended it to me and I was previously using Eclipse for 10 years
or so.

My advice: do exactly what Lukasz said. If you want to have some great
support for your struts 2 dev, go with IntelliJ and forget Eclipse and
Netbeans.


On Fri, Apr 20, 2012 at 4:20 AM, Frans Thamura <frans@(protected):
> as a eclipse user. :) any idea?
>
>
> F
>
> On Fri, Apr 20, 2012 at 1:19 AM, Łukasz Lenart <lukasz.lenart@(protected)
>> wrote:
>
>> 2012/4/19 rob stone <floriparob@(protected)>:
>> > I am trying to incorporate the Struts 2 plug-in into the Netbeans IDE
>> > and having problems. The Netbeans version is 7.0.1 which is the latest
>> > available for Debian.
>>
>> Use IntelliJ IDEA, give up with NB ;-)
>>
>>
>> Kind regards
>> --
>> Łukasz http://www.lenart.org.pl/
>> mobile +48 606 323 122, office +27 11 0838747
>> Warszawa JUG conference - Confitura http://confitura.pl/
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>



--
http://www.grobmeier.de
https://www.timeandbill.de


Attachment: user_212751.eml (zipped)
+1 for Intellij Idea (I'm an happy more-than-ten-year user), but I
should also mention that, on the contrary of eclipse and nb, you have
to buy the licence for commercial sw (but it's really worth every
dollar)

Twitter     :http://www.twitter.com/m_cucchiara
G+          :https://plus.google.com/107903711540963855921
Linkedin    :http://www.linkedin.com/in/mauriziocucchiara

Maurizio Cucchiara



On 20 April 2012 10:45, Christian Grobmeier <grobmeier@(protected):
> I have tried Eclipse and Netbeans and finally found out that life is
> so freaking easy with IntelliJ and the Struts 2 plugin.
> I could not believe it first, because it was the Struts-guys who
> recommended it to me and I was previously using Eclipse for 10 years
> or so.
>
> My advice: do exactly what Lukasz said. If you want to have some great
> support for your struts 2 dev, go with IntelliJ and forget Eclipse and
> Netbeans.
>
>
> On Fri, Apr 20, 2012 at 4:20 AM, Frans Thamura <frans@(protected):
>> as a eclipse user. :) any idea?
>>
>>
>> F
>>
>> On Fri, Apr 20, 2012 at 1:19 AM, Łukasz Lenart <lukasz.lenart@(protected)
>>> wrote:
>>
>>> 2012/4/19 rob stone <floriparob@(protected)>:
>>> > I am trying to incorporate the Struts 2 plug-in into the Netbeans IDE
>>> > and having problems. The Netbeans version is 7.0.1 which is the latest
>>> > available for Debian.
>>>
>>> Use IntelliJ IDEA, give up with NB ;-)
>>>
>>>
>>> Kind regards
>>> --
>>> Łukasz http://www.lenart.org.pl/
>>> mobile +48 606 323 122, office +27 11 0838747
>>> Warszawa JUG conference - Confitura http://confitura.pl/
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>>> For additional commands, e-mail: user-help@(protected)
>>>
>>>
>
>
>
> --
> http://www.grobmeier.de
> https://www.timeandbill.de
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>


Attachment: user_212748.eml (zipped)
a brief explanation for basic spring-security (only authentication)
configuration with struts:

Spring security is running as a filter in your web-app
(you need to make sure that it comes first before Struts).
For the filter-configuration take a look at (2.2.1):
http://static.springsource.org/spring-security/site/docs/3.0.x/reference/ns-config.html

Than you will have to provide a context file where you
define the whole configuration for Spring-security:
- <intercept-url pattern="" access=""/> : access roles for certain url
patterns
- <form-login login-page="your-struts-login-action" /> : configuration
for login
- <authentication-manager> : to provide a service for
user-authentication, like:
<authentication-manager>
<authentication-provider
user-service-ref="your-authentication-service"> [...]

The last step is the implementation of the authentication-service
(http://static.springsource.org/spring-security/site/docs/3.0.x/apidocs/org/springframework/security/core/userdetails/UserDetailsService.html):
UserDetails loadUserByUsername(String username)
and UserDetails-Interfaces (your User-Bean).

For all authenticated struts-actions you can get UserDetail
by accessing
SecurityContextHolder.getContext().getAuthentication().getPrincipal()
(http://static.springsource.org/spring-security/site/docs/3.0.x/apidocs/org/springframework/security/core/context/SecurityContextHolder.html)

I hope i could help you with this short explanation which covers only
basic usage of spring.


Attachment: user_212752.eml (zipped)
Hello All,

Project architecture based on Struts 2 + Spring 3 + Spring JDBC<http://www.coderanch.com/forums/f-3/JDBC> Template + Extjs 4.1 + Oracle 11g + Weblogic 10.3.4
I have used Extjs 4.1 to develop the UI layer. In the js page i want the combo box to be populated based on the data available on the DB.
Here is the part of my js file

var crudComboStore = new Ext.data.JsonStore({
storeId: 'table_list',
proxy: {
type: 'ajax',
url: 'adminProcess.action',
reader: {
type: 'json',
root: 'crudData'
}
},
fields : ['tablename', 'displayName']
});
crudComboStore.load();

So when request will come to the above js page it will call adminProcess.action to get the data for combo box.
Here is the struts.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts<http://www.coderanch.com/forums/f-58/Struts> PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<constant name="struts.enable.DynamicMethodInvocation" value="false" />
<constant name="struts.devMode" value="false" />

<package name="default" namespace="/" extends="struts-default">

<action name="adminForm">
<result>admin/admin.html</result>
</action>

<action name="adminProcess" method="getMasterTableList"
class="com.gm.gpd.admin.action.AdminAction">
<result name="input">admin/admin.html</result>
<result name="error">admin/admin.html</result>
<result name="success">admin/success.jsp</result>
</action>
</package>
</struts>

So if you will check the struts.xml the request should now come into getMasterTableList method of the AdminAction.java.
However it is not at all entering into the getMasterTableList method.

FYI
The above piece of code is working fine with Tomcat.
Don't understand why it is not working in Weblogic.
Kindly suggest me a solution so that it will start working in weblogic as well.
Thanks in advance.




Best regards,
Biswajit
Planned Vacation : From 2-July-2012 to 6-July-2012

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