Migration Help for angular2

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Migration Help for angular2

Gopal, Siva Prakash (US - Mechanicsburg Delivery)
Hi Team,

Our current application is developed based on Strut2 with presentation layer as JSP. We would like to upgrade presentation layer as responsive (Planning to use Angular 6) and continue to reuse our backend code base (Strut2 as controller).

On high-level, we understand that add JSON plugin https://struts.apache.org/plugins/json/  to get all class level parameter in action class as json. But how to reuse chaining (one action to another action class), validation method in action class, etc..

Do we have any recommended approach to handle this scenario.

Let us know if further information is required.

Thanks,
Siva

This message (including any attachments) contains confidential information intended for a specific individual and purpose, and is protected by law. If you are not the intended recipient, you should delete this message and any disclosure, copying, or distribution of this message, or the taking of any action based on it, by you is strictly prohibited.

Deloitte refers to a Deloitte member firm, one of its related entities, or Deloitte Touche Tohmatsu Limited ("DTTL"). Each Deloitte member firm is a separate legal entity and a member of DTTL. DTTL does not provide services to clients. Please see www.deloitte.com/about to learn more.

v.E.1
Reply | Threaded
Open this post in threaded view
|

Re: Migration Help for angular2

Lukasz Lenart
wt., 14 maj 2019 o 16:50 Gopal, Siva Prakash (US - Mechanicsburg
Delivery) <[hidden email]> napisał(a):
> Our current application is developed based on Strut2 with presentation layer as JSP. We would like to upgrade presentation layer as responsive (Planning to use Angular 6) and continue to reuse our backend code base (Strut2 as controller).
>
> On high-level, we understand that add JSON plugin https://struts.apache.org/plugins/json/  to get all class level parameter in action class as json. But how to reuse chaining (one action to another action class), validation method in action class, etc..

You can return validation errors via JSON as well [1] and chaining
will work as usual

[1] https://struts.apache.org/plugins/json/json-ajax-validation


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

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: Migration Help for angular2

Gopal, Siva Prakash (US - Mechanicsburg Delivery)
Thanks for your help

Do we have recommended approach to handle this. One.

Do we need to add any wrapper on top of the existing action class. Can you please suggest some approach on it.

Regards,
Siva

-----Original Message-----
From: Lukasz Lenart <[hidden email]>
Sent: Thursday, May 16, 2019 3:04 AM
To: Struts Users Mailing List <[hidden email]>
Subject: [EXT] Re: Migration Help for angular2

wt., 14 maj 2019 o 16:50 Gopal, Siva Prakash (US - Mechanicsburg
Delivery) <[hidden email]> napisał(a):
> Our current application is developed based on Strut2 with presentation layer as JSP. We would like to upgrade presentation layer as responsive (Planning to use Angular 6) and continue to reuse our backend code base (Strut2 as controller).
>
> On high-level, we understand that add JSON plugin https://secure-web.cisco.com/1SvOc2FXTfqLGn8EW8CYhF0w70KuLpoOiTBFbwmCxP9-q7unCUidwFGv9db_sLISDOrwsMm_Gxerv3DSujVnDq2vreunJsn78vbsgTPVcfe8vgjNiqmRSoKnlFtl9bzDufJxohvUfDR0zP_gTZdtyt8b_uiQFMK74QzPithLWVUg12WlzqYuVu9xRIY4WdexOlVBEttrPdRhfSVrAvg_Gy35Ck28DTrGW4EyWK0C0HyFymM9tpjKucHN1dvqS_V356XfsRVGtUvR2JB94mk7Un9IkYyvGy0e_2cnFENX-hV8WBJAURmkurzt9YcCmFIGdEh94XxXQuKNKqCAmGRYSwaI1-UXaeViYXn4k1ayHPT-7Ggx8TkM2L5xRSo3HsCZ7IB6j-VaxbqINflyvVr1tMnM4g-A0QIoUSuQM8XfzoXzhkwmno9PvXVtka-cJLQKOKvwxoiArkWx6RkOMwVrNswxj1w3cLTYnTsIQLeX1I0yyylrj9CCoFkcQFamtK67x8dlHwBbnuGp4FrmeYq7uEA/https%3A%2F%2Fstruts.apache.org%2Fplugins%2Fjson%2F  to get all class level parameter in action class as json. But how to reuse chaining (one action to another action class), validation method in action class, etc..

You can return validation errors via JSON as well [1] and chaining will work as usual

[1] https://secure-web.cisco.com/15UIo1NhgZKCKwTlinwkkEixEVMkFh4yoTQveTtdfT8RXlBoe0K3I6vurvjjiXBli8dUmnjtNZoolCLyuuS8fNO-zCOi1V3UiPyi1oFEBgRQXETFkBnFJGTQrWjFv_C6i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enart.org.pl%2F

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]


This message (including any attachments) contains confidential information intended for a specific individual and purpose, and is protected by law. If you are not the intended recipient, you should delete this message and any disclosure, copying, or distribution of this message, or the taking of any action based on it, by you is strictly prohibited.

Deloitte refers to a Deloitte member firm, one of its related entities, or Deloitte Touche Tohmatsu Limited ("DTTL"). Each Deloitte member firm is a separate legal entity and a member of DTTL. DTTL does not provide services to clients. Please see www.deloitte.com/about to learn more.

v.E.1

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Migration Help for angular2

Lukasz Lenart
wt., 21 maj 2019 o 18:17 Gopal, Siva Prakash (US - Mechanicsburg
Delivery) <[hidden email]> napisał(a):
>
> Thanks for your help
>
> Do we have recommended approach to handle this. One.
>
> Do we need to add any wrapper on top of the existing action class. Can you please suggest some approach on it.

Not sure what do you mean by that, all depends on your application
setup and what plugins do you use, etc. Asking more precise questions
can help get answers.


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

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: Migration Help for angular2

Gopal, Siva Prakash (US - Mechanicsburg Delivery)
Our Current Application as below structure



Config.xml



                <action name="credentials" class="CredentialsAction"

                                                method="loadForgotCredentials">

                                                <param name="anonymous">true</param>

                                                <result name="success">success.jsp</result> -> jsp (tiles-def)

                                                <result name="passreset" type="chain">resetSubmit</result> <!--chaining action-->

                </action>



                Action class



                class CredentialsAction{

                                private String username;

                                private String pwd;



                                public String loadForgotCredentials(){

                                                if(true){

                                                                return success;

                                                }else{

                                                                return passreset;

                                                }

                                }



                }

                Currently (http:\\localhost\Demo\credentials) it will render JSP or chaining to another action class.



                What is best approach to change above structure to return as json response for API call. Since i need to use that api call in angular code.



Let me know if further informationi is required.



Thanks,

Siva











-----Original Message-----
From: Lukasz Lenart <[hidden email]>
Sent: Wednesday, May 22, 2019 2:09 AM
To: Struts Users Mailing List <[hidden email]>
Subject: [EXT] Re: Migration Help for angular2



wt., 21 maj 2019 o 18:17 Gopal, Siva Prakash (US - Mechanicsburg

Delivery) <[hidden email]<mailto:[hidden email]>> napisał(a):

>

> Thanks for your help

>

> Do we have recommended approach to handle this. One.

>

> Do we need to add any wrapper on top of the existing action class. Can you please suggest some approach on it.



Not sure what do you mean by that, all depends on your application setup and what plugins do you use, etc. Asking more precise questions can help get answers.





Regards

--

Łukasz

+ 48 606 323 122

+ http://secure-web.cisco.com/1uK3CuqyR1LY1XTM0xwJqt_u-syPUkeqsJLwSI_lec

+ vlh7mMaj4uu-k8mveGp8wJjMbidiPn9rTD9wZWZSddXK0-1WVOuVFEyv2Y5DSsNqIBkOKL

+ 3hdzo03tJp_pajAHFoc767Hu1wNKeeV8MaA1FSg8Q1su4AlBnX0f85H6AA_uHbCQ-pIt8_

+ gCePs_MMHKwcgNGyEbh_mCdHTvinNo_udRX5iwq6BGCMKFJN-XyqP5ccQN4pNQZfdbdDvK

+ tqVTV5Hl36XIHD0FOwd7KGEHZ0djC8uHPLURk0aEqRE5iGJ1A1H9asFkCPJPGg4TZoGLYB

+ 1WYv4ZRcPSrOLXZI11aWo4bz8V46Y1rZALzQ33Ze4EqLUOHPGcTwfN3nEyLHRaGtDZjcXV

+ eBk6q_K7JM4yrF0nArO3ZUcooywe3oe4BmrU3cqbgBuW4S2Eqni9z45tFBuIsvHCWxUOkX

+ P3piEEqPVjuOAByrj_MrRGnaraa-JWbWZjOK_pIAfUo13JvcF8Y/http%3A%2F%2Fwww.l

+ enart.org.pl%2F



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

To unsubscribe, e-mail: [hidden email]<mailto:[hidden email]>

For additional commands, e-mail: [hidden email]<mailto:[hidden email]>





This message (including any attachments) contains confidential information intended for a specific individual and purpose, and is protected by law. If you are not the intended recipient, you should delete this message and any disclosure, copying, or distribution of this message, or the taking of any action based on it, by you is strictly prohibited.

Deloitte refers to a Deloitte member firm, one of its related entities, or Deloitte Touche Tohmatsu Limited ("DTTL"). Each Deloitte member firm is a separate legal entity and a member of DTTL. DTTL does not provide services to clients. Please see www.deloitte.com/about to learn more.

v.E.1
Reply | Threaded
Open this post in threaded view
|

RE: Migration Help for angular2

Yasser Zamani-2


>-----Original Message-----
>From: Gopal, Siva Prakash (US - Mechanicsburg Delivery)
><[hidden email]>
>Sent: Wednesday, May 22, 2019 10:51 AM
>To: Struts Users Mailing List <[hidden email]>
>Subject: RE: Migration Help for angular2
>
>Our Current Application as below structure
>
>
>
>Config.xml
>
>
>
>                <action name="credentials" class="CredentialsAction"
>
>                                                method="loadForgotCredentials">
>
>                                                <param name="anonymous">true</param>
>
>                                                <result name="success">success.jsp</result> -> jsp
>(tiles-def)
>
>                                                <result name="passreset"
>type="chain">resetSubmit</result> <!--chaining action-->
>
>                </action>
>
>
>
>                Action class
>
>
>
>                class CredentialsAction{
>
>                                private String username;
>
>                                private String pwd;
>
>
>
>                                public String loadForgotCredentials(){
>
>                                                if(true){
>
>                                                                return success;
>
>                                                }else{
>
>                                                                return passreset;
>
>                                                }
>
>                                }
>
>
>
>                }
>
>                Currently (http:\\localhost\Demo\credentials) it will render JSP or
>chaining to another action class.
>
>
>
>                What is best approach to change above structure to return as json
>response for API call. Since i need to use that api call in angular code.


Hi Siva,

Use Struts "JSON Plugin" [1] which has json result for actions [2]. Regarding chains, use json result for last action in the chain e.g. for resetSubmit action in your example above.

Regards.

[1] https://struts.apache.org/plugins/json/
[2] https://struts.apache.org/plugins/json/#write-the-mapping-for-the-action


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]