greptilian logo

IRC log for #javaee, 2014-01-27

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
01:01 AartBluestoke joined ##javaee
01:14 AartBluestoke joined ##javaee
04:16 firebird1 joined ##javaee
04:44 kotten joined ##javaee
05:03 firebird1 working with jasper today
05:03 firebird1 :(
05:08 firebird1 final ill do crosstab bit complex
05:27 weyer joined ##javaee
06:37 ramsrib joined ##javaee
07:17 neuro_sys joined ##javaee
07:35 AlexCzar joined ##javaee
08:30 StephenS joined ##javaee
08:30 StephenS javaWE
08:38 fabioportieri joined ##javaee
08:43 book` joined ##javaee
08:44 StephenS left ##javaee
08:58 fabioportieri morning
09:03 neuro_sys morning
09:06 fabioportieri neuro_sys: o/
09:23 sess ugh a new customer wants to put my site in an iframe
09:23 sess we already have severe width issues
09:26 neuro_sys tell them to pay more
09:26 neuro_sys that you need more moonies to stop bitching
09:36 firebird1 joined ##javaee
09:42 firebird1 joined ##javaee
09:58 sess What's the standard way to set locale etc. from the url used to an application?
09:58 sess lets say I register mypage.se and mypage.no - is there a good way to change locale and other small things without parsing the url?
09:59 sess both urls leading to the same server of course
10:03 firebird1 helloooo
10:03 firebird1 why you need to parse url ?
10:03 firebird1 how did you think parsing url was the solution
10:09 Lappro joined ##javaee
10:12 sess I did not think it was the solution
10:12 sess it was the way I did NOT want to solve it
10:12 sess it could work in theory by for example having a web filter, parsin the domain name and setting locale from it
10:14 fabioportieri sess: i think this http://docs.oracle.com/javaee/6/api/javax/servlet/ServletRequest.html#getLocale%28%29
10:16 sess that just uses the client browser locale
10:16 sess I want it based on the domain name used
10:16 sess there is no api for that
10:17 neuro_sys one could also think locale should be what's deciding the page language regardless of the domain name.
10:18 sess neuro_sys: this is not just language, content differs greatly
10:18 sess think more of region support
10:19 sess for multi country sites
10:19 sess and a user with a certain locale might want to visit other regions to do work there
10:19 neuro_sys so it is and should be the same webapp for both domains despite the differing content
10:20 neuro_sys is that so
10:20 sess yes
10:20 neuro_sys anyways, I don't know how else other than by checking the domain name you could achieve that.
10:20 sess and locale is pretty random
10:20 sess from my own browser its en_US
10:21 sess because i happen to want english language in my browser
10:21 sess i wonder how other companies solve the same issue
10:22 neuro_sys you're doing it by parsing the domain in a webfilter now?
10:23 sess I'm not doing it at all, we're just planning an expansion stage
10:23 sess where my customer sells our service to other companies in other regions
10:24 sess and they want different urls so the companies in other regions can pretend it's their own service
10:28 neuro_sys the easiest and dirtiest hack would be to check that in a filter I think, and set a http header based on the domain name
10:29 sess yeah i know, but I'd rather have a standard widely used solution
10:29 sess like having some static redirect from .no leading into a /no/ context path and using that
10:29 sess or whatever
10:30 neuro_sys that sounds like the more common approach
10:30 neuro_sys as far as I can see on the web
10:31 neuro_sys but that'd mean two contexts, and two distinct webapps deployed, right?
10:32 neuro_sys well, not necessarily hehe
10:32 neuro_sys could still check that in a filter and redirect/set things accordingly
10:32 neuro_sys in the same context
10:48 sess neuro_sys: no it could be a single webapp
10:48 sess but you'd need some fancy url handling
10:49 sess there are probably libraries that can pick out the region from an /se/ and then redirect to the correct jsf page, ignoring the /se/ part
11:13 sess come think of it, this is only an issue for the login page, because when I know who is logged in I know which region he wants
11:27 firebird1 joined ##javaee
11:50 firebird1 http://www.ft.com/cms/s/0/b1c42040-8721-11e3-9c5c-00144feab7de.html
12:10 kotten joined ##javaee
12:17 AlexCzar joined ##javaee
12:32 firebird1 whole night doing jasper :(
12:33 sess fate worse than death
12:51 werebutt joined ##javaee
12:51 werebutt left ##javaee
13:03 CJ_ Anyone have any opinions on using jasypt vs the default shiro hashing?
13:16 CJ_ joined ##javaee
13:41 sajjadg joined ##javaee
14:52 sajjadg joined ##javaee
15:10 firebird1 joined ##javaee
16:04 kobain joined ##javaee
16:23 sajjadg joined ##javaee
16:25 fabioportieri joined ##javaee
16:37 jieryn_ joined ##javaee
16:54 AlexCzar joined ##javaee
17:01 neuro_sys joined ##javaee
17:06 Naros joined ##javaee
17:06 Naros left ##javaee
17:14 firebird1 joined ##javaee
18:08 Naros_ joined ##javaee
18:09 Naros_ left ##javaee
19:56 Quest joined ##javaee
19:57 Quest Do you guys agree with the answer or any comments ? http://stackoverflow.com/questions/21292366/returning-message-with-object-in-spring-ajax-method-for-java-script-to-read
20:56 AlexCzar I prefer RESTful-like protocol, most of the time front-end can derive message from the returned http status
20:56 AlexCzar If some kind of entity is needed, I return object and use Spring's content negotiation
20:57 AlexCzar Quest, ↑
20:58 drspockbr joined ##javaee
21:04 Quest hm
21:05 Quest AlexCzar,  but what if an object and some messages are also to be passed to jsp
21:05 AlexCzar In that case I ModelMap is your friend
21:05 AlexCzar %s/I//g
21:05 Quest put everything in model map?
21:05 AlexCzar yes
21:06 AlexCzar eg map.addAttribute("ent", entity);
21:06 AlexCzar map.addAttribute("messages", messages);
21:06 AlexCzar etc.
21:07 Quest ajax cant read model map
21:07 Quest javaascript i   mean
21:09 Quest AlexCzar,  right?
21:12 AlexCzar There is a bit hacky solution - pull out the data using taglib into hidden dom elements, then access it with javascript, but I'd resot to RESTful-like approach if I'm using AJAX
21:13 AlexCzar Do you understand that JSP is Server-side technology?
21:14 semiosis Quest: use json
21:14 AlexCzar So you can't exactly pull something via ajax and pass it to JSP processing without calling server again
21:15 semiosis modern ajax apps use json encoding to transport model representations between client & server
21:16 conor_ireland joined ##javaee
21:16 AlexCzar Yes and Spring supports automatic mapping and content negotiation, JSON and XML being the most used mappings (AFAIK)
21:19 Quest AlexCzar,  yes
21:20 Quest semiosis,  AlexCzar  how about picture data maping?
21:20 semiosis a URL in a json document pointing to the image resource
21:21 Quest hm
21:21 AlexCzar I would strongly recommend against returning image itself in an ajax call
21:22 Quest AlexCzar,  just for know how, how can images be return?
21:22 AlexCzar as a byte stream
21:22 AlexCzar or encoded to base 64
21:22 AlexCzar or something like that
21:22 semiosis one of my programmers wrote something to return base64 encoded image data in a json document, that was a bad day
21:22 Quest base 64 encode. ok
21:22 AlexCzar JUST DON'T DO THAT!
21:22 AlexCzar :D
21:22 semiosis Quest: an endpoint in your api which serves image bytes
21:22 Quest why bad day?
21:23 Quest AlexCzar,  why?
21:23 semiosis why not just render the whole page server side & serve one big jpeg to the browser?
21:24 Quest no interactivity
21:24 semiosis why?  because there are tools for serving images & it's silly not to use them
21:24 semiosis a url pointing to an image can be used by lots & lots of programs
21:24 Quest hm'
21:24 semiosis a json doc with b64 data in it is ad-hoc
21:25 Quest b64 cant be used by all apps?
21:25 AlexCzar semiosis, also you're adding two conversions to the pipeline (b64enc on server-side, b64dec on client-side)
21:25 AlexCzar sorry, was addressed to Quest
21:26 Quest but all my app is made with modelMap and sending object to jsp
21:27 AlexCzar Quest, so? what's your point?
21:27 Quest cant change that much. what can be the appropriate solution for time being
21:27 Quest what choices I may have
21:27 AlexCzar for returning image?
21:28 Quest returning strings + objects in normal redirect and in ajax calls
21:28 Quest objects = lists and objects
21:28 semiosis idk what we're talking about
21:28 AlexCzar me too
21:29 Quest http://stackoverflow.com/questions/21292366/returning-message-with-object-in-spring-ajax-method-for-java-script-to-read
21:29 Quest this^
21:29 AlexCzar you have modelmap, you have response body, what's the holdup?
21:29 Quest modelmap can be sent to ajax call?
21:30 AlexCzar NO! To ajax you send an object mapped to any format you prefer, e.g. JSON
21:30 AlexCzar or XML
21:31 semiosis Quest: you said "but all my app is made with modelMap and sending object to jsp"
21:31 semiosis Quest: so what is making an AJAX call then?
21:31 Quest semiosis,  the client in jsp
21:31 Quest so I first map my object to JSON object and send it like @ResponseBody String method() ?
21:32 Quest return JSONObject?
21:32 AlexCzar yes, or you can use springs builtin mapper
21:32 Quest semiosis,  AlexCzar  didnt got it well
21:32 Quest can anyone one show  pseudo code?
21:32 Quest http://pastie.org
21:32 AlexCzar Quest, http://www.mkyong.com/spring-mvc/spring-3-mvc-and-json-example/
21:34 Quest sh*t
21:34 Quest this is it?
21:34 Quest simple it was
21:35 AlexCzar by the way it's the first result for "spring json example" google query
21:36 Quest so shop.setStaffName(new String[]{"mkyong1", "mkyong2"});return shop; is a Java object that can be mapped to JSON object automatically and read by the javascript? can a modelMap object do the same?
21:38 Quest AlexCzar,  semiosis  ^
21:38 semiosis i dont use spring mvc so cant help much on implementation (just strategy/arch)
21:39 Quest k
21:39 semiosis i have a rest api (with jax-rs/jersey) and a frontend in angularjs
21:39 Quest k
21:58 sajjadg joined ##javaee
22:13 sfisque joined ##javaee
23:21 jmcveity joined ##javaee

| 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.