greptilian logo

IRC log for #javaee, 2013-11-10

Please see http://irclog.greptilian.com/javaee for which days have been logged.

| Channels | #javaee index | Today | | Search | Google Search | Plain-Text | plain, newest first | summary

All times shown according to UTC.

Time S Nick Message
00:07 wnc joined ##javaee
00:08 wnc hello
00:08 wnc i'm newbie in java
00:09 wnc where to go
00:10 wnc left ##javaee
00:13 MegaMatt joined ##javaee
02:13 scripty joined ##javaee
04:07 cem_ joined ##javaee
04:08 cem_ watashi javaee
04:33 cem_ joins are crazy
05:20 cem_ left ##javaee
05:30 wq joined ##javaee
05:33 scripty left ##javaee
06:34 scripty joined ##javaee
06:34 * scripty one of the worst discussion is explaning the co-worker how to use google
08:34 AlCoF joined ##javaee
10:34 WileTheCoyot joined ##javaee
10:34 WileTheCoyot hello everyone
10:37 WileTheCoyot is possible to call a method inside jstl?
10:39 sess WileTheCoyot: with servlet 3.0 you can call methods with parameters
10:39 sess though you can define EL function is you want some common general method
10:40 WileTheCoyot i'm using servlet 2.5
10:41 WileTheCoyot i have static methods inside classes is possible call them in el?
10:42 sess no, not directly
10:42 sess you can proxy-call them
10:42 sess via another non-static methods
10:43 sess in a EL function or something
10:43 sess WileTheCoyot:  http://stackoverflow.com/questions/6395621/how-to-call-a-static-method-in-jsp-el
10:51 WileTheCoyot sess: where should i declare these proxy function?
10:52 sess as you see in the link
10:52 sess either in a getter
10:52 sess or declare it as an EL function
10:52 sess public getX(){return MyClass.staticMethod()}
10:53 sess ${myBean.x}
10:53 sess that doesnt allow for parameters though
10:54 WileTheCoyot the problem is that i have a lot of static function (e.g. managers) and it will be a huge work write all the functions
10:54 sess what is their purpose?
10:54 sess calculate things? fetch data?
10:54 WileTheCoyot for example
10:54 WileTheCoyot i have an user beans
10:55 WileTheCoyot and a manager UserManager which interact with database
10:55 WileTheCoyot in a jsp i need to show a message depends on the type of the user
10:55 zoot use of the static keyword offen means that the class has no unittest :P
10:56 WileTheCoyot zoot: for example i have insert which insert an user into the db
10:56 sess WileTheCoyot:  you should populate a bean before rendering the jsp
10:56 sess and just read from the bean in the JSP
10:57 WileTheCoyot sess: how could i do that?
10:58 zoot upgrade til ee5+ :P
10:58 zoot to*
10:59 sess WileTheCoyot:  what web framework do you use?
10:59 sess struts, spring, simple servlets?
10:59 WileTheCoyot simple jsp and servlet
11:00 sess oh dear
11:00 sess anyways
11:00 sess define a class with the fields you need to read/write to from the jsp
11:01 sess create an instance of it in your servlet, and put the instance as a request attribute
11:01 sess then just refer to it with jsp EL
11:01 sess you should probably read up on some tutorials
11:01 sess since this is very basic stuff
11:02 WileTheCoyot so i need an new servlet for each class?
11:03 sess rather a new servlet for each page
11:03 sess you should really use a framework for this
11:04 zoot WileTheCoyot: welcome to the 10s, please leave all your technical dubt at the door
11:04 WileTheCoyot and then how could i call methods in el? can you make me an example? thanks a lot
11:04 WileTheCoyot zoot: what do you mean?
11:05 sess request.setAttribute("myBean", myBean)
11:05 sess in jsp: ${myBean.property}
11:06 sess WileTheCoyot:  you are using very old technology and the way youre doing it will be impossible to maintain in the long run
11:06 sess if youre doing anything but a very small application
11:06 zoot what sess said.
11:07 WileTheCoyot sess: yu're right but i need to learn basic java ee first and then start using some framework
11:07 sess well for education purposes it's fine
11:07 sess as long as it's not used in production :p
11:07 WileTheCoyot thanks for your help
11:10 Losowski joined ##javaee
11:39 Losowski left ##javaee
12:07 MegaMatt joined ##javaee
13:09 scripty joined ##javaee
14:01 MegaMatt joined ##javaee
14:14 MegaMatt joined ##javaee
15:09 AlCoF___ joined ##javaee
15:31 WileTheCoyot joined ##javaee
15:31 WileTheCoyot hello everyone
15:32 WileTheCoyot is possible to use the tag <jsp:include page=""/> with a variable?
15:39 sess you can include parameters yes
15:39 sess as child tags
15:39 sess i dont remember the namespace, but something like <jsp:param name="x" value="y*/>
15:40 WileTheCoyot i'm writing a jsp which take a string from url (get method) and show it inside a jsp page
15:41 WileTheCoyot within a div
15:41 sess you dont need to send that as a parameter
15:41 sess included jsps all have access to the request object, including query string
15:41 sess bbl running for a bit
15:42 WileTheCoyot i have a page with some divs (header, navbar, content and footer)
15:43 WileTheCoyot now only content change bttwen two jsp
15:43 WileTheCoyot and if i pass the url to a page (e.g. index.jsp?page=user/login.jsp)
15:44 WileTheCoyot it will show me the login page in the content div
15:59 pdurbin WileTheCoyot: I'm confused. Are you still having a problem or are you all set?
16:03 sess WileTheCoyot:  im not sure what youre doing, but i can promise that is the opposite of best practice
16:04 sess anti-pattern if you will
16:05 WileTheCoyot i just want to show the content of a jsp inside a div
16:05 sess yes, but the reasons you want to that sounds bad
16:05 sfisque basically poorman's tiles
16:06 sess even non-poormans tiles is horrid
16:06 sess i.e actual tiles
16:06 sfisque how so?
16:06 sess extremly hard to follow the flow of code
16:06 sess if you find x.jsp
16:06 WileTheCoyot just because other parts of the page doesn't change so why should i rewrite them everytime?
16:06 sess you have no idea where it's used
16:07 sess WileTheCoyot:  because jsp does not support proper templating
16:07 sfisque if you say so
16:07 sess sfisque: i can only speak from own experience, but i strongly dislike tiles
16:08 sess one thing jsf does well
16:08 sfisque struts/tiles, like any framework can be abused, yes, but a well thought out S/T project is a dream to work with
16:08 sfisque well, except jsf solves a different problem
16:09 WileTheCoyot so should i avoid this?
16:09 pdurbin JSF has templates, as many here know
16:09 sfisque yes facelets
16:09 WileTheCoyot i'm using simple jsp
16:09 WileTheCoyot not frameworks
16:10 sfisque the problem is, you cannot do deep linking unless you invert flow
16:10 WileTheCoyot sfisque: waht do you mean?
16:11 sfisque in jsf, you cannot deep link to a controller url, unlike struts/tiles or spring mvc.  thus you have to do some "magic" regarding data martialling
16:13 sfisque that's pretty much because jsf is not "view based", but "component based".  it's stellar for "single page with dynamic content" design, but not very good for heavy view based transition, especially if you allow deep linking
16:13 pdurbin sfisque: "view based transition"? ... does Faces Flow address that?
16:14 sfisque dunno.
16:14 sfisque javaeebot lucky faces flow
16:14 javaeebot sfisque: http://docs.oracle.com/javaee/7/tutorial/doc/jsf-configure003.htm
16:15 sfisque ah, ee7, i've not dug into the new ee7 tech
16:15 acuzio oh jesus - faces
16:15 pdurbin sfisque: yeah. "For example, you might want to create a series of pages for the checkout process in an online store."
16:15 sess sfisque:  i was just refering to the ui:composition tag of jsf
16:15 sess which is how templating is supposed to be
16:16 sfisque well, two avenues, you can decorate or can composite
16:16 sfisque or both
16:16 pdurbin sfisque: "view based transition"? ... does Faces Flow address that? (take 2) :)
16:17 sfisque not from what i can see by skim reading.  it looks like FF is the new "conversation scoped"
16:17 pdurbin ok. hmm
16:17 pdurbin javaeebot: lucky view based transition
16:17 javaeebot pdurbin: http://stackoverflow.com/questions/10845785/left-to-right-transition-in-view-based-application-on-moving-from-one-view-contr
16:18 WileTheCoyot so should i avoid this? :) i have no idea what are toy telling about
16:22 sess WileTheCoyot:  having a single servlet that forwards to a jsp described in jsp is a very limited method of doing things
16:22 sess described in query string*
16:23 sess to make it work well, you need the servlet to be able to forward to other servlets
16:23 sess so you can seperate things
16:23 sess and if you do build that, you basicly have struts/spring mvc
16:24 pdurbin so what's a good lightweight solution for WileTheCoyot?
16:25 sess from what i know, he's just experimenting for learning javaee
16:25 WileTheCoyot sess: yu're right
16:26 sess id say, just make a few servlets/jsps, then move on to learning an mvc framework when you understand what happens under the hood
16:26 pdurbin so... WileTheCoyot should just use JSF for its templates, right? JSF being part of the Java EE spec.
16:26 sess jsf is not very good for learning
16:27 sess way too complicated and full of magic that kindofish workd
16:27 sess s
16:27 pdurbin sess: I couldn't agree more. That
16:27 sess even in the hands of experienced programmers, jsf has as many bad parts as good ones
16:28 pdurbin yeah
16:28 pdurbin but at least JSF is portable. part of the spec
16:28 sess well I dont know how often you'd want to switch JSF implementation
16:28 WileTheCoyot i start programming with java ee about a month ago
16:29 WileTheCoyot so should i start learning jsf?
16:29 sess kind of depends on what you want to do
16:29 pdurbin sess: hmm. I guess I'm using whatever JSF implementation is in Glassfish. But I assume my app would work the same way on JBoss
16:29 sess the normal choice is either JSF, or use JSP with spring mvc or struts (struts was more common in older apps)
16:30 sess pdurbin:  most likely, as would any jsp
16:30 sess i think both GF and jboss uses mojarra
16:31 pdurbin sess: ok. makes sense
16:31 sess i think there are only mojarra and myfaces?
16:31 pdurbin ah
16:31 sess perhaps one more that i cant think of
16:32 pdurbin WileTheCoyot: the argument from Oracle these days seems to be that JSF (let's say as of Java EE 7) has caught up with Spring MVC or Struts... that JSF is "good enough" now
16:33 sess oh i actually think jboss uses myfaces
16:33 sess ive never even used anything vendor specific for jsf, so it succeeded with portability i guess
16:33 WileTheCoyot so let's start learning jsf :)
16:33 WileTheCoyot thank you
16:34 pdurbin WileTheCoyot: don't hate if you don't like JSF :)
16:34 pdurbin don't hate me*
16:34 pdurbin it's full of magic :)
16:35 WileTheCoyot pdurbin: we will see ....
16:35 sess jsf is extremly fast for development, but when you do get a problem
16:35 WileTheCoyot pdurbin: :)
16:35 sess it will take you countless hours to solve
16:35 pdurbin sess: I assume that's true of say... Ruby on Rails as well
16:36 sess @ViewScope is extremly practical though
16:36 sess i always use it when using jsf
16:37 sess jsf promises you the moon and the stars
16:37 sess but you dont quite get that :D
16:38 pdurbin sfisque: what's a view based transition?
16:55 sfisque view based transition, one view asks for another view during a workflow (rather than just a subset refresh of the page).  in order to marshall the data for that view, (in jsf) the page has to know about that next view if my action="someTemplate.xhtml" because that action doesnt trigger any data marshalling.  so i now have to embed the url with all sorts of direct controller calls to make sure the necessary data is marshalled, wh
16:56 sfisque originally in jsf you were supposed to do "action=#{someController.someMethod()}" but that breaks back-button and deep linking
16:56 sess lol jsf was supposed to use post redirects for navigation by design?
16:57 sfisque well, how else are you going to marshall data without embedding controller logic in the view?
16:58 sfisque the nav semantic in jsf is broken for data heavy view based workflows.
16:58 sfisque well, not broken, but promotes several anti-patterns
17:02 scripty joined ##javaee
17:06 sess i had some issues with that when taking over a JSF project that used post navigation
17:07 sess namely, security doesnt work..
17:07 sess the URL would lag behind 1 step
17:09 pdurbin sfisque: does the back button work properly in JSF apps you've worked on? We've had trouble with the back button: https://redmine.hmdc.harvard.edu/issues/2850 https://redmine.hmdc.harvard.edu/issues/2859 https://redmine.hmdc.harvard.edu/issues/3101
17:09 sfisque yeah, i'm working on porting my home apps from jsf to S2/T2 because i hate embedding a bunch of <f:actionListener> in every commandLink
17:10 AlCoF__ joined ##javaee
17:10 sfisque we DID have issues, pdurbin, but like i mentioned, we had to convert all the action="#{method}" attributes to action="facelet.xhtml" and then embed all sorts of <f:actionListener> tags in every linkage.  just what every website needs, controller semantics in the templates :-P
17:11 sfisque sequential coupling anti-pattern, 4tW!
17:11 sess i just use the Post Redirect Get pattern
17:11 sess everywhere
17:11 sess works good
17:11 sess ish
17:12 sess though it feels like what should be the default way of navigating is a hack
17:13 pdurbin sfisque: interesting. thanks. it definitely came up at JavaOne... question from the audience... "does the back button work now?" -- http://irclog.greptilian.com/javaee/2013-09-23#i_24826 :)
17:13 sfisque yub
17:14 sfisque my one complaint with S2/T2 (though maybe they've fixed it recently, have to check) is that ajax support is very "bolted on" and does not integrate smoothly, i feel
17:15 kobain joined ##javaee
17:15 sess i had so much issues with back buttons that i turned off caching completly
17:15 sess back button does a clean new request in my projects these days
17:16 pdurbin sess: when using JSF?
17:16 sess yeah
17:16 sess i get users complaining about things not working
17:16 sess sending very weird screenshots
17:17 sess that i have no chance to recreate
17:17 sess a bunch of it is almost certainly related to back button things
17:17 sess combined with viewscope things
17:18 pdurbin sess: even though @ViewScope is extremely practical :)
17:18 sess yes...
17:19 pdurbin it'd be nice to start with a small reproducible test case of back button brokenness
17:19 scripty left ##javaee
17:31 sess if the user uses IE8, the page gets cached and it's full moon
17:33 pdurbin JSF becomes a werewolf? :)
17:34 sess jsf will throw a FullMoonException
17:34 sfisque both cheeks?
17:34 pdurbin heh
17:35 sess ;/
17:55 sfisque anyone have any have expirience with shiro
17:57 sess was that a security framework?
17:58 sfisque IS, yes
17:58 sfisque i was curious if anyone has used it and how it compared to JAAS
17:58 sess was thinking of trying it out once, but never did. My experience ends there :)
17:58 sfisque :-)
17:58 sess does it really replace JAAS?
17:58 sess rather than wrap it
17:59 sfisque not sure.  hence my question
17:59 sfisque it looks like it's an API and IMPL, so i'm going to guess it is parallel to jaas (as in you use this instead of jaas)
17:59 sfisque but that is a guess
17:59 sess man its old
17:59 sess 2003
18:00 sess Shiro's predecessor, JSecurity, was founded in 2004 by Les Hazlewood and Jeremy Haile because they could not find a suitable Java security frameworks that operated well at the application level and they were frustrated with JAAS.
18:00 sess sounds like it doesnt use JAAS then ;p
18:01 sess i normally just use jboss security and leave it at that
18:06 * pdurbin looks at http://shiro.apache.org
18:07 pdurbin "The validationProcol can be SAML" -- http://shiro.apache.org/cas.html
18:08 pdurbin of course, I've never heard of CAS... http://www.jasig.org/cas
18:24 cem_ joined ##javaee
18:25 cem_ oz
18:30 AlCoF__ joined ##javaee
20:32 Naros joined ##javaee
20:35 kobain joined ##javaee
21:48 Naros joined ##javaee
22:23 Lappro joined ##javaee
22:46 AlCoF joined ##javaee
23:52 zoot http://pastebin.com/jYD9UBfe
23:53 zoot what i'm doing wrong?
23:53 zoot i droped that env-thingy in my web.xml
23:55 zoot hm.. i can't find jndiname=java:comp/env/hello

| Channels | #javaee index | Today | | Search | Google Search | Plain-Text | plain, newest first | summary

Please see http://irclog.greptilian.com/javaee for which days have been logged.