AngularJS and JEE

4,438 views
Skip to first unread message

Mahmoud Belhaoaune

unread,
Feb 22, 2013, 7:52:43 AM2/22/13
to ang...@googlegroups.com
Hey guys!

This is a question that has been running back and forth through my mind for a while now.

Could angularJS be used in a Java web application (JSP & servlet based application per se)?

And if so, how could this be done?

Infact i tried to copy the content of an HTML page from an HTML file(that I'm using in an AngularJS app) into a jsp file.

The problem is that Eclipse doesn't approve the Angluar attributs (eg. ng-app ).

Thank you.

Witold Szczerba

unread,
Feb 22, 2013, 9:58:46 AM2/22/13
to ang...@googlegroups.com
I am using AngularJS with JavaEE back end with spectacular success :) I am not using JSPs, but JAX-RS and static HTML templates. However, you could use JSPs to provide translations.

Regards,
Witold Szczerba



--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Mahmoud Belhaoaune

unread,
Feb 22, 2013, 10:16:41 AM2/22/13
to ang...@googlegroups.com

Thank you Witold. Does anyone know how could this be done? (making JSP pages accept angularJS syntax.) :)

Clint Checketts

unread,
Feb 22, 2013, 11:10:16 AM2/22/13
to ang...@googlegroups.com
Have you tried adding the ng namespace and using the ng:app syntax?

(I have no idea myself on how this would be done)


On Fri, Feb 22, 2013 at 8:16 AM, Mahmoud Belhaoaune <mahmoud.b...@gmail.com> wrote:

Thank you Witold. Does anyone know how could this be done? (making JSP pages accept angularJS syntax.) :)

Mahmoud Belhaoaune

unread,
Feb 22, 2013, 1:14:21 PM2/22/13
to ang...@googlegroups.com
Yup! Yeah I checked out on that. Nothing happens though. Man not a mere example on the net about something like this!

I think that using AngularJS with SP isn't that healthy. :D

I hope that somebody will inform me about this issue. :(

Marco Rinck

unread,
Feb 22, 2013, 3:01:25 PM2/22/13
to ang...@googlegroups.com
You don't find any examples as the best usecase for angularJS and JEE is using a JaxRS backend (in JEE container) and static html files without any Java Frontend technology like JSP, JSF whatsoever. 

Really, what do you need JSP for when you have a first class web app powered by angularJS? 

Marco 

Clint Checketts

unread,
Feb 22, 2013, 3:05:07 PM2/22/13
to ang...@googlegroups.com
The only reason I would use a JSP would be to bootstrap data into my page similar to the technique noted here: http://www.jvandemo.com/2013/01/10/how-to-bootstrap-data-in-angularjs/

I would only do it for the single base page. (not sure about Mahmoud's need though)

-Clint


--

Mahmoud Belhaoaune

unread,
Feb 22, 2013, 3:44:56 PM2/22/13
to ang...@googlegroups.com
Hey!

Thank you all for your responses.

In fact I'm an intern in a company that works on JEE applications with JSP.

My coach wants to use some JS Framework such as Angular in their presentation layer.

He has no idea about it though. He asked me to do some research and to see if it would be suitable.

Well, it appears that using Angular with JSPs isn't advisable.

So guys, what do you propose as a framework that functions weel with JSPs?  :)

Marco Rinck

unread,
Feb 22, 2013, 3:52:46 PM2/22/13
to ang...@googlegroups.com
If I could choose freely for a new project/site I would trash JSP and choose JaxRS and a modern MVC Javascript framework like angularJS, backbone or whatever suits fit. 

If the team lacks the javascript know how I would trash JSP and choose JSF flavoured with PrimeFaces or RichFaces and some manual jQuery. Server-side frameworks don't work well with client-side MVC frameworks ihmo.  

I would NEVER choose JSP anymore. That is stoneage, really. 

Marco

Mahmoud Belhaoaune

unread,
Feb 22, 2013, 4:03:40 PM2/22/13
to ang...@googlegroups.com
Thanks Marco!

In fact, they asked another intern to try and integrate primefaces or icefaces in their projects.

Well, I guess this is the point then, finding a new way other than JSP. I'll suggest this alternative.

It is interesting and exciting. Hope I will make a point. :)


Le vendredi 22 février 2013 13:52:43 UTC+1, Mahmoud Belhaoaune a écrit :

Mahmoud Belhaoaune

unread,
Feb 23, 2013, 2:30:31 AM2/23/13
to ang...@googlegroups.com
Hello, in the project I'm working on I'm going to draw charts and other graphics related to statistics. Would AngularJs be any good for this

kind of mission? (talking about using it with JaxRS of course)

Thanks.


Le vendredi 22 février 2013 13:52:43 UTC+1, Mahmoud Belhaoaune a écrit :

Rafael Nami

unread,
Feb 23, 2013, 8:16:26 AM2/23/13
to ang...@googlegroups.com

I've started using in a pet project, but drop out all jsp in favor to pure html... I prefer static pages accessing dynamic data opposing dynamic pages... And for the eclipse errors, you can disable JSP syntax validation.


Cheers

--
Message has been deleted

Pankaj Tandon

unread,
Aug 25, 2013, 8:38:11 PM8/25/13
to ang...@googlegroups.com
I've written an Angular app that does just that here.
http://pointy-nayidisha.rhcloud.com/pointy

and the source is here:
https://github.com/pankajtandon/PointyPatient

Rafik BOUGHANI

unread,
Jun 5, 2014, 8:13:13 AM6/5/14
to ang...@googlegroups.com


Le vendredi 22 février 2013 13:52:43 UTC+1, Mahmoud Belhaoaune a écrit :

aset...@gmail.com

unread,
Jun 5, 2014, 2:02:19 PM6/5/14
to ang...@googlegroups.com
I played around with JSP and AngularJS (inside Spring framework) .. you can simply declare your ng-app module in the html tag as follow.  If the code validation complaining about "ng-app", try to use "data-ng-app".  It is not eclipse that is complaining, HTML5 prefers the "data-" prefix.

<%@ include file="/WEB-INF/view/layout/header.jsp"%>

<!doctype html>
<html ng-app="accountDashboard">
<head>
<meta charset="ISO-8859-1">
<title>Insert title here</title>
<link href="${pageContext.request.contextPath}/static/css/main.css">
</head>
<body>
...
<script ... to import angularJS library>
</body>
</html>

paulj...@gmail.com

unread,
Jul 1, 2014, 6:57:24 AM7/1/14
to ang...@googlegroups.com
Hi Guys,
could someone articulate to me the side effects / benefits of using JSP and Angular JS together?
I have a feeling this is not advisable, but dont know enough as to what could be amiss. Please help!

Thanks!

paulj...@gmail.com

unread,
Jul 6, 2014, 3:21:43 AM7/6/14
to ang...@googlegroups.com
HI Rafik,
 
could you please explain  the side effects / benefits of using JSP and Angular JS together?

I have a feeling this is not advisable, but dont know enough as to what could be amiss. Please help!

Thanks!

paulj...@gmail.com

unread,
Jul 6, 2014, 3:21:58 AM7/6/14
to ang...@googlegroups.com
HI ,

 
could you please explain  the side effects / benefits of using JSP and Angular JS together?
I have a feeling this is not advisable, but dont know enough as to what could be amiss. Please help!

Thanks!

Raj Saini

unread,
Jul 6, 2014, 3:31:09 AM7/6/14
to ang...@googlegroups.com
Hello,

There should not be any issue with using JSP with AngularJS as JSP can emit JavaScript and HTML. However, more relevant question is why would you want to use the JSP? What is the you can't do in HTML and plain JS that you want to bring in JSP? Please note JSP is a templating language and you cant write the web services in JSP. I use JSP in my project to generate the app.js dynamically as our project have multiple modules and each module is  OSGi bundle.

If you let us know what exactly you want to do, we can suggest you a better approach.

Regards,

Raj
--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Paul John Karimpuzhikat

unread,
Jul 6, 2014, 6:11:44 AM7/6/14
to ang...@googlegroups.com, Rahim Haji
Thank you Raj. That makes perfect sense. I currently am working on an existing java codebase (jsp templates and so on).
We were thinking of introducing Angular into this current application stack. I was trying to vet out the different approaches, either starting a whole new application from scratch (100%angular) talking to Rest services vs introducing angular in the current java / jsp codebase.
Just wanted to get your thoughts on these two approaches?

Thanks,
Paul


--
You received this message because you are subscribed to a topic in the Google Groups "AngularJS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/angular/VHoGG6oaVqs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to angular+u...@googlegroups.com.

Raj Saini

unread,
Jul 6, 2014, 6:17:11 AM7/6/14
to ang...@googlegroups.com
Hello Paul,

The approach I took is to use plain HTML/Angular along with RESTful services approach as I do not see JSP adding any value here. AngularJS is a client side MVC and I do not see need of another MVC at server side. However, you may need bit of JSP and may be a servlet (of course you can use a MVC if you want) to dynamic generate your home page (index.html). You may also need it if you want to inject a active profile of the user or if you want to authenticate without loading the index.html file.

Regards,

Raj

Paul John Karimpuzhikat

unread,
Jul 6, 2014, 6:26:12 AM7/6/14
to ang...@googlegroups.com, Rahim Haji
Raj,
Thanks a lot for answering my question.  I really needed a sounding board on this one!
 
Let me ask you another question. We are in the process of building a full blown news website (responsive site). We think Angular would be a great framework to build this in.

What do you think?  I feel like we dont see enough sites that are entirely built on Angular. is it bcos there is some pitfalls with Angular?

Thanks,
Paul

Jayanta Pramanik

unread,
Jul 7, 2014, 6:45:01 AM7/7/14
to ang...@googlegroups.com
Hi All,

Hi All,

AngularJS is new web UI that may replace JSP. But before that few questions  how it can be used in secured web application. For example if any banking/financial application is built with AngularJS isn't there vulnerability exists which may cause future complexities.

How different secured REST call can be done or what are different security can be taken for web portal ?

Regards,

Jayanta P.
Message has been deleted

Jayanta Pramanik

unread,
Jul 7, 2014, 9:47:32 PM7/7/14
to ang...@googlegroups.com
Hi All,

Please let me clear more about security issues that may arise from Javascripts
OWASP recommended top 10 security measures. Javascript itself is very much vulnerable and prone to get XSS , CSRF attack ! Then Angular JS being  javascript in origin how can we protect data and implement OWASP guideline for our financial application. How can we encrypt param values if we want to do that while calling RESTservice from web portal to middleware backend.

Regards,

Jayanta P.

mulianto

unread,
Jul 8, 2014, 5:24:33 AM7/8/14
to ang...@googlegroups.com
Use https to encrypt everything on wire.

Its simple and proven ...

Sent from my iPhone
--

Jayanta Pramanik

unread,
Jul 8, 2014, 8:58:59 AM7/8/14
to ang...@googlegroups.com

Hi,

actually any financial application has to be secured with respect to OWASP top 10 guidelines. How Angular JS can protect us from those vulnerabilities and how can we implement those OWASP recommended security measures.

Regards

Jayanta P.

Sushil Das

unread,
Sep 11, 2015, 2:30:37 AM9/11/15
to AngularJS
Reply all
Reply to author
Forward
0 new messages