greptilian logo

IRC log for #javaee, 2013-11-19

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:06 cem_ in psql i do this psql --username postgres then on enter it asks for password but default it wont  , how to do that in java :P max you can give is property file
00:06 whartung the pg_hba conf file can limit users to connections and IPs
00:06 whartung so you can disable 'postgres' from network connections, for example
00:08 sfisque do they still have the "adopt a jsr" page.  i cannot find it on the jcp.org site
00:28 cem_ i created another user the result is same thing :(
00:29 cem_ same exception
00:51 cem_ only way saying trust all ;)
01:03 cem_ k restarted the service  couple of times it connected
01:03 cem_ with password :)
01:03 whartung just keep kicking it cem_ , it'll work eventually! :)
01:41 cem_check joined ##javaee
01:43 cem_check this cem_check here calm down , no trouble
02:12 cem_check hi
02:12 cem_ cem_check: i'll pm u
03:38 kobain joined ##javaee
03:52 cem_ hmm
04:55 Quest joined ##javaee
06:52 dangertools joined ##javaee
07:27 SoniEx2 joined ##javaee
07:45 weyer joined ##javaee
08:19 weyer joined ##javaee
09:22 callMeBaby joined ##javaee
10:21 Quest joined ##javaee
10:39 callMeBaby joined ##javaee
10:53 drspockbr joined ##javaee
11:03 Quest_ joined ##javaee
11:12 callMeBaby joined ##javaee
11:12 Guest71645 joined ##javaee
11:31 naue joined ##javaee
11:37 sajjadg joined ##javaee
11:38 MegaMatt joined ##javaee
12:54 sajjadg joined ##javaee
13:01 cem_ joined ##javaee
13:21 Guest71645 joined ##javaee
13:32 cem_ got addicted to addons :(
13:33 cem_ https://addons.mozilla.org/en-US/firefox/addon/fb-purity-cleans-up-facebook
13:51 jieryn joined ##javaee
13:51 jieryn joined ##javaee
14:38 Naros joined ##javaee
14:51 Guest20878 joined ##javaee
14:54 Guest20878 like in struts2 we can get request params (both get and post) by class fields. Is there a similar way in spring 3 ?
15:07 sross07 joined ##javaee
15:08 sess Guest20878: it's very convenient in spring 3, you make your "action" like this for example: public ModelAndView getSomePage(@Param String requestparam){...}
15:08 Guest20878 hm
15:08 sess you can inject query string values as method parameters, also allows for automatic type converstion between simple types such as numbers and dates
15:08 Guest20878 sess,  I want to upload  a file and get it
15:08 sess would pick spring any day over struts
15:09 Guest20878 sess,  I want to upload  a file and get it .  public ModelAndView getSomePage(@Param String requestparam){...}        would be fine?
15:12 sess a file upload isnt in a querystring..
15:12 Guest20878 and do I have to define it for every method?  why cant I do it for the full class. just once and al methods use it
15:12 sess you would use a form for that
15:12 Guest20878 sess,  ya. its POST
15:12 sess if you make a formbean
15:12 Guest20878 and @RequestMapping(value = "/", method = RequestMethod.GET)      would be invalid for it
15:12 Guest20878 isnt there a way to get both GET and POST in that method?
15:13 sess and post it, you can inject it into the method like public ModelAndVide handleFileUpload(@Model MyForm myform)
15:13 sess something like that
15:13 sess method is an array
15:13 sess and you can remove method, and it will listen to all requests on that url
15:13 Guest20878 <sess> and you can remove method, and it will listen to all requests on that url ?
15:14 sess the method attribute
15:14 sess you would never set request mapping value to /
15:14 Guest20878 ya. that was an eg
15:14 sess @RequestMapping(value="/uploadFile") would listen to all posts or gets
15:15 Guest20878 @RequestMapping(value="/uploadFile", method = RequestMethod.GET
15:15 Guest20878 now how to get POST data in it?
15:18 sess you cant
15:18 sess you just specified it should only listen to GET...
15:25 Guest20878 in struts, you get the GET    AND  POST  by field vars.   just wanted same for spring
15:25 sess spring works differently, dont try to ram struts into it
15:25 sess and that has nothing to do with the last thing you posted
15:28 Guest20878 ok. so is there a way for a mapping (that results in a method in the controller to execute)  so that I can get both GET and POST param values in that method ?
15:28 Guest20878 simple question^
15:30 sess you are confused
15:31 sess http request can be POST or GET
15:31 Guest20878 am.. yes
15:31 Guest20878 yes
15:31 sess parameters exists for both of these
15:31 Guest20878 but one request can have both GET data and POST data
15:31 sess mixing "post param" and "get param" makes no sense
15:31 sess no
15:31 sess post is post
15:31 sess get is get
15:31 sess pick one
15:32 sess either you GET and send data via querystring
15:32 sess or you POST and send data via post parameters
15:32 sess they are read the same way server side
15:32 Guest20878 wait. if I hit        mysite.com?id=1   and that page also had a form with method POST  input text "userName".  I WILL get both  id value and the userName
15:33 sess define "hit"
15:34 Guest20878 open the page in browser with said form and url
15:34 Guest20878 well to be precise:
15:34 sess when you visit the page in the browser you do a GET
15:34 sess if that page has a form, you can later POST data
15:34 sess querystring will not follow unless it is posted
15:34 Guest20878 the action of the form had    mysite.com?id=1     method POST      and form input text "userName".  I WILL get both  id value and the userName
15:35 sess yes thats because id is posted
15:35 Guest20878 got it
15:35 sess the querystring counts as a request parameter in a POST
15:36 Guest20878 now in spring      mapping of           site.com/foo/bar   method.POST with some form data.                  I will get it by post. understandable. ok. fine uptil here now.        BUT   isnt foo/bar is itself a get param under the hood?
15:38 sess no, foo/bar is part of the URI
15:38 Guest20878 hm
15:38 Guest20878 what about foo/23243/bar
15:38 sess request parameters is a simple key/value map
15:38 sess still the URI
15:39 sess protocol://domain/path?querystring
15:39 sess querystring is send as keyvalue pairs called request parameters
15:39 sess when POSTing, the inputs of the selected form will be sent as request parameters, as well as any query string in the form action
15:39 Guest20878 the id is still a url? @RequestMapping (value = "/boards/{id}")
15:39 Guest20878 public String viewBoard(ModelMap model, @PathVariable(value="id") String id){
15:40 sess pretty much
15:40 Guest20878 not a get?
15:40 sess it wont show up in request.getParameter
15:40 Guest20878 hm
15:40 sess look you need to read some basic tutorial
15:40 sess if you dont know the difference between an url and a GET
15:41 Guest20878 but this is.  @RequestMapping (value = "/box/create/{parent}/{parentId}/{bo​xType}/{boxTitle}/{boxDescription}", method=RequestMethod.GET)
15:41 Guest20878 public @ResponseBody  Boxes createBox(ModelMap model,
15:41 Guest20878 @PathVariable(value="parent") String parent,
16:06 philbot joined ##javaee
16:06 Topic for ##javaee is now Core Java (Java SE) AND Java Enterprise Edition (Java EE) discussion | ##javaee-offtopic for all kinds of non-tech chat| logs at http://irclog.greptilian.com/javaee/today
16:19 sfisque very separate on the client side. form params are encoded as a stream in the body following the headers.   url params are url-encoded
16:19 sfisque s/form/post
16:40 Guest20878 thx!
16:41 bitwize joined ##javaee
17:57 sajjadg joined ##javaee
18:08 cem_ weird thing happend
18:11 cem_ my driver gets added automatically even without reflection
18:12 sfisque joined ##javaee
18:13 cem_ its not a weird thing ?
18:17 cem_ sfisque san how can that happen ?
18:27 sfisque i just logged in, what are we talking about?
18:27 sfisque i was offline about 2 hours
19:13 cem_ my driver gets added automatically even without reflection sfisque
19:13 sfisque what driver gets added to waht?
19:24 bitwize joined ##javaee
19:29 cem_ i dont need to do Class.forName("org.postgresql.Driver") because as soon as i add referenced library it gets added to my driver registry
19:37 sfisque depends. in a container environment, that is true.  for a standalone program, you need to "bootstrap" the driver into the DriverManager by doing the class.forName trick
19:37 whartung the connection pool would load it for you in the container
19:43 cem_ thank you , but this may scare you i dont have a container
19:43 cem_ i'm just doing a normal jdbc thing
19:44 sfisque are you using a framework, like spring?
19:45 cem_ no
19:45 sfisque i wonder if it's a feature of the new jdbc4
19:45 sfisque is your driver installed in the jdk lib dir?
19:46 cem_ huh ? how to find out that
19:46 sfisque what database are you using?  javadb?  hsql?  mysql?
19:47 cem_ postgres
19:49 sfisque dunno then
19:50 cem_ i guess new feature
21:05 cem_ k i want to ask to all seniors out here , what is the difference between people who work for 5+ year in a company vs 10-20 years people in java field(since this is java channel :P )?  (sorry to ask such a newbie question)
21:13 sess has java even existed for 20 years
21:15 sfisque almost
21:15 sfisque well, probably, if you count the time in secret incubation inside sun labs
21:15 sfisque 0.92b debuted around 18 years ago
21:16 sfisque javaeebot lucky java sun history version labs
21:16 javaeebot sfisque: http://en.wikipedia.org/wiki/Sun_Microsystems
21:17 sess so someone who worked in secret sun labs
21:17 sess anyone?
21:17 sfisque javaeebot lucky gosling java
21:17 javaeebot sfisque: http://en.wikipedia.org/wiki/James_Gosling
21:17 semiosis http://en.wikipedia.org/wiki/Java_(software_platform)#History
21:17 semiosis "The Java platform and language began as an internal project at Sun Microsystems in December 1990"...
21:18 sfisque so, 23 years
21:18 sfisque almost
21:18 semiosis http://en.wikipedia.org/wiki/Java_version_history
21:18 semiosis JDK 1.0 (January 23, 1996)
21:18 sfisque EE dates to around '99 when they released the first white paper
21:18 semiosis so, depends where you start counting
21:18 semiosis that too
21:19 sfisque that's when 1.0 came out.  there were a couple 0.x versions available for download before 1.0 was released
21:19 whartung yea, 1996 was the number in my head
21:20 sfisque i can't remember exactly when i dl'ed it, but i'm guessing fall of '95 sounds about right
21:20 sfisque so figure about now, 18 years ago
21:20 sfisque as far as "the outside world" is concerned
21:21 whartung I started with java in … 99? I think
21:21 sfisque good time.  birth of collections and jdbc api around that time
21:22 sfisque 1.2 was a huge api change
21:22 sfisque i'd say the biggest releases to date have been 1.1, 1.2, and 1.5.  all the others were mostly "incremental"
21:23 sfisque the addition of reflection was immense
21:24 sfisque 1.8 will be the next "big one" with closures
21:24 whartung yea 1.2 was huge
21:24 whartung 1.8 will dramatically change coding style and apis
21:24 cem_ does more experienced people know how jvm works like that ?
21:25 sfisque depends cem_
21:25 sfisque javaeebot lucky book the java virtual machine
21:25 javaeebot sfisque: http://www.artima.com/jvm/booklist.html
21:25 sfisque if you really really really want to know how java works:  http://www.amazon.com/exec/obidos/ASIN/0071350934/billvennersA
21:26 sfisque inside the jvm is dense, but you really learn a lot
21:26 sfisque i have the version that corresponds to the 1.2 release and i'd say 75% of it is still relevant
21:30 whartung what's in that book sfisque
21:30 whartung how does it compare to the VM spec
21:31 sfisque examples and discussions around various topics, rather than pure crunch of the spec
21:32 sfisque it has both crunch and a pretty good discussion layer throughout
21:32 sfisque more approachable than the vm spec
21:32 sfisque after reading that book, you could conceivably write java-assembler code
21:33 cem_ there are more things in java(apart from general algorithm) and its very dense(couldnt get my head around) ( guess didnt ask  bad question :) )
21:33 sfisque which has been done.  back around the 1.1 days, there was a 3d library where the guy writing it actually hand tooled some of the lib at the byte code level
21:33 sfisque for performance
21:34 sfisque you could build a rudimentary doom style game that ran reasonably well on a P1-90
21:34 sfisque in java
21:36 whartung http://www.artima.com/insidejvm/ed2/
21:36 sfisque oh neat, he's public domaining the content?
21:36 whartung somebody is :D
21:37 whartung I mean, it is 13 years old -- that's almost 13 years in internet time…or something
21:37 whartung but I think it would be interesting to read just to see the design of a modern VM
21:37 sfisque about 539 years, by internet time
21:37 sfisque :P
21:37 whartung I've threatened to port the UCSD P-System in the past, and that's a VM.
21:37 whartung of sorts
21:37 whartung it's not a vm
21:38 whartung it's a pcode thing…I consider a VM different
21:38 sfisque are the pcodes JIT'ed?
21:39 whartung no, they didn't do a lot of JITing back in '77 :D
21:39 sfisque i was always astonished on how fast ucsd pascal ran on my apple II compared to applebasic hwich was evaluated at runtime
21:40 sfisque so if it's not runtime mangled, how would it run if not via VM?
21:40 sfisque sincere question, i'm curious
21:40 * cem_ you people are above limits :/
21:41 whartung I consider a VM to be a higher level construct than a Pcode thing, for example Sweet16 is certainly not a VM
21:42 whartung Sweet16 was Wozniaks 16 bit assembly thing he did for the Apple ][
21:42 whartung http://en.wikipedia.org/wiki/SWEET16
21:43 sfisque i am intrigued, i must now start googling to discern how the ucsd p-code system differs from a "virtual machine".
21:44 whartung Now, the P-Machine is arguably a VM, now whether the P-Code is distinct from the P-Machine is topic for discussion
21:44 whartung there are a lot of significant internal details in the P-Code
21:45 whartung but, for example, the file system is NOT part of the p-code - so.
21:45 whartung I think the Jave VM specifies much more detail about its operation environment that P-Code ever did, though P-Code was no doubt assumed to run within a P-Machine
21:46 whartung and arguably, JVM Byte Code does not a JVM make.
21:46 whartung so, I may just be splitting hairs.
21:46 whartung I do not consider a BASIC to be a "VM" though, in any way.
21:59 semiosis how about perl?
22:00 * semiosis ducks
22:03 whartung perl, no. Parrot, not sure.
22:12 sfisque arguably, the file system isnt part of the jvm either.  you can run applets which are purely memory bound unless the security is relaxed
22:19 sfisque so, with obligatory grain of salt (from wikipedia, so integrity of the data is up for debate):
22:19 sfisque In http://en.wikipedia.org/wiki/Computer_programming, a p-code machine, or portable code machine[http://en.wikipedia.org/wiki/Wikipedia:Citation_needed] is a http://en.wikipedia.org/wiki/Virtual_machine designed to execute p-code (the http://en.wikipedia.org/wiki/Machine_language of a hypothetical CPU). This term is applied both generically to all such machines (such as the http://en.wikipedia.org/wiki/Java_Virtual_Machine and http://en.wikipedia.org/wiki/
22:19 sfisque blah, i hate that it expands the links like that when i paste
22:19 sfisque is that an artifact of our irc server or my client?
22:19 sfisque probably my client
22:21 sfisque so it is "argued" by the article that a p-code machine is an example of a VM
22:22 sfisque hah sweet-16 is the first link in the "see also" list of the article
22:30 whartung I guess it's a matter of design
22:30 whartung for example
22:30 whartung BASIC is tokenized
22:31 whartung "IF" becomes token 1, "THEN" token 2, etc.
22:31 whartung that's different than a synthetic instruction set
22:31 whartung which is what p-code is
22:31 sfisque right.  but i'm guessing the p-code machine is not straight tokenization but actual compilation
22:31 sfisque into some "intermediate" format
22:31 sfisque right
22:36 sfisque if i were going to write a jee app that used a nosql impl to store attachments (versus blobbing them into an rdbms) what impls would people recommend.  bonus points if i can run it inside the container as a "rar" or "sar" or similar and expose it as a pooled datasource endpoint.
22:36 whartung wait what?
22:37 whartung oh are you looking for nosql suggestion?
22:37 sfisque suggestions for specific impls.
22:37 whartung of nosql
22:37 sfisque yes
22:37 whartung ok
22:37 whartung biab
22:38 * sfisque waves to whartung
22:38 cem_ here is the http://kickass.to/inside-the-java-virtual-machine-bill-venners-idm-t3079781.html#main
22:39 sfisque oh my god, i'm so dense.   it never occurred to me that ldap is a form of nosql.  i could leverage openldap
22:39 sfisque it wouldnt run in the container but having a jndi interface would make the integration clean
22:39 semiosis S3
22:40 sfisque javaeebot lucky s3 nosql
22:40 javaeebot sfisque: http://newtech.about.com/od/databasemanagement/a/Nosql.htm
22:40 semiosis amazon s3
22:40 * cem_ is a super n00b
22:41 sfisque oh, i'd prefer to host it natively and not in someone elses cloud
22:42 semiosis sfisque: so these are potentially large binary attachments?  also how are you retrieving them?  do you hold a reference to an attachment ID or do you need to search attachment contents?
22:42 sfisque it would be purely key -> attachment blob
22:42 sfisque and have key -> (n) metadata in the rdbms for search reasons
22:43 semiosis is the rdbms inside the container?
22:43 sfisque attachement {  Integer key;  @OneToMany List<Object> metadataValues };
22:43 sfisque nah, remote exposed via jdbc pool/datasource
22:44 sfisque remote == in same local cloud, different machine
22:44 semiosis afaik these things are usually standalone services, like an rdbms, not running inside the container
22:45 sfisque that's fine.  i was just saying that IF something like that existed, i'd prefer it, but it's not a "show stopper" feature
22:46 sfisque i know ObjectDB is embeddable, but i do not know if they have a "container deployment" version
22:47 sfisque but i do run openldap internally, so that could be an option.  a JNDI interface would be clean and not necessitate writing lots of handler code
22:48 sfisque and i'd get "hierarchy" for free by design
22:48 sfisque and some level of security
22:49 semiosis heard of riak?
22:49 semiosis that migth be interesting
22:49 sfisque no
22:49 sfisque javaeebot riak nosql
22:49 javaeebot sfisque: Error: "riak" is not a valid command.
22:49 sfisque bah
22:49 sfisque javaeebot lucky riak nosql
22:49 javaeebot sfisque: http://basho.com/riak/
22:50 semiosis https://basho.com/tag/object-storage/
22:52 sfisque nifty, so it basically self-torrents the data for replication and fault tolerence
22:52 sfisque neat-oh
22:52 sfisque i don't need that level of distributed processing, so maybe overkill, but riak itself might be ok (not the CS version)
22:52 sfisque i will have to ponder
22:53 * sfisque gets a far away look in his eye
23:12 kobain 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.