Time |
S |
Nick |
Message |
00:21 |
|
|
tommmied joined ##javaee |
00:40 |
|
pdurbin |
sfisque: yeah, use iptables I guess |
00:51 |
|
pdurbin |
"i'd rather run something lighter weight than apache" sounds funny in a world of glassfish et al. ;) |
02:10 |
|
sfisque |
except you're missing the point. i'm using most of the services exposed by jboss. i'm not using anything in apache other than proxying for jboss. overkill |
02:41 |
|
|
firebird1 joined ##javaee |
04:31 |
|
|
firebird1 joined ##javaee |
04:36 |
|
semiosis |
sfisque: never used it but i've heard Pound is a good proxy... http://www.apsis.ch/pound |
04:36 |
|
|
firebird1 joined ##javaee |
04:57 |
|
sfisque |
that looks promising, thanks semiosis |
04:57 |
|
semiosis |
yw |
05:01 |
|
|
firebird1 joined ##javaee |
05:05 |
|
firebird1 |
love to do a tool for java :) >> this happened in my dream |
08:11 |
|
|
PrinceMotumbo joined ##javaee |
08:14 |
|
|
firebird1 joined ##javaee |
08:31 |
|
|
mikee joined ##javaee |
09:31 |
|
|
firebird1 joined ##javaee |
11:23 |
|
|
sajjadg joined ##javaee |
11:24 |
|
|
firebird1 joined ##javaee |
11:31 |
|
|
cutepro joined ##javaee |
11:31 |
|
cutepro |
In struts 2, In an action class, I want to redirect user to a page?someMessage=message . the page is in web/jsp/ . How can I do that? |
11:32 |
|
firebird1 |
does jsf has default icons ?? |
11:37 |
|
firebird1 |
cutepro, do you mean 404 ? |
11:37 |
|
firebird1 |
for 404 ? |
11:37 |
|
firebird1 |
i dont know about your BL |
11:37 |
|
cutepro |
yes |
11:38 |
|
firebird1 |
use web.xml for that |
11:38 |
|
cutepro |
how? |
11:41 |
|
cutepro |
firebird1 ok. in a servlet mapped as /myServlet, would response.sendRedirect("jsp/emailconfirmation.jsp?massage="+message); in that servlet be ok? and will it redirect to the web/jsp/emailconfirmation.jsp page? |
11:43 |
|
firebird1 |
i dont know about your BL but any way add a errorcode tag and give a location wrt url |
11:43 |
|
cutepro |
ok |
11:43 |
|
cutepro |
in a servlet mapped as /myServlet, would response.sendRedirect("jsp/emailconfirmation.jsp?massage="+message); in that servlet be ok? and will it redirect to the web/jsp/emailconfirmation.jsp page? |
11:44 |
|
firebird1 |
why you need servlet ? |
11:45 |
|
firebird1 |
is this specific ? |
11:45 |
|
cutepro |
I did that but still getting 404 error. |
11:45 |
|
firebird1 |
or general 404 |
11:45 |
|
cutepro |
404 not found |
11:45 |
|
firebird1 |
i mean wrt pathinfo |
11:46 |
|
cutepro |
wrt? |
11:51 |
|
firebird1 |
cutepro, what you need ? |
11:51 |
|
firebird1 |
post ur web.xml in pastebin |
11:53 |
|
firebird1 |
p:growl is not working |
11:53 |
|
firebird1 |
but p:message does |
11:54 |
|
|
firebird1 joined ##javaee |
11:58 |
|
cutepro |
http://pastie.org/8638713#34,49,138 lines 35,50 and 144 |
12:08 |
|
firebird1 |
k |
12:08 |
|
firebird1 |
it will redirect to url based |
12:09 |
|
firebird1 |
http://ip:port/ct/jsp/emailconfirmation.jsp |
12:10 |
|
cutepro |
whats ct? |
12:10 |
|
firebird1 |
what ct would be ? |
12:11 |
|
cutepro |
:port/ct/jsp/ |
12:12 |
|
firebird1 |
lol |
12:12 |
|
firebird1 |
ct is just placeholder for context |
12:13 |
|
cutepro |
how do I find out the project name? |
12:13 |
|
firebird1 |
paste ur url |
12:14 |
|
firebird1 |
why gowl is not working ? |
12:15 |
|
cutepro |
http://localhost:8080/struts-dbservice-4.0 <projectDescription> |
12:15 |
|
cutepro |
<name>struts-dbservice-4.0</name> in .project file in exlipse |
12:17 |
|
cutepro |
I think a service is being used that auto maps the ActionClassesAcion.java to site.com/project/action-classes.action |
12:23 |
|
firebird1 |
i'm going to use diff report seriously jasper report is meant for sfisque,Fubar^ not for me |
12:29 |
|
firebird1 |
why we give private static final long serialVersionUID = 1L; ? saw some tut didnt get it :/ sfisque |
12:31 |
|
|
Ziberius joined ##javaee |
13:56 |
|
|
weyer joined ##javaee |
14:11 |
|
|
Naros joined ##javaee |
14:32 |
|
|
firebird1 joined ##javaee |
14:35 |
|
firebird1 |
Hello World |
14:36 |
|
sajjadg |
hello firebird1 |
14:44 |
|
|
jieryn joined ##javaee |
14:44 |
|
|
jieryn joined ##javaee |
14:48 |
|
|
sheenobu joined ##javaee |
15:00 |
|
|
weyer joined ##javaee |
15:06 |
|
|
tommmied joined ##javaee |
15:08 |
|
|
kobain joined ##javaee |
15:27 |
|
firebird1 |
i'm fan of senior citizens :/ |
15:31 |
|
sfisque |
firebird1 serialVersionUID is a "magic" attribute used by the de/serialization (ObjectStream) support in java. when the non transient parts of an object that gets de/seriealized change, the UID has to change so that ObjectStream knows whether it can properly handle the payload with the class defined in memory |
15:37 |
|
|
weyer joined ##javaee |
15:38 |
|
pdurbin |
I'm curious what people think about this question: http://stackoverflow.com/questions/356248/best-way-to-return-status-flag-and-message-from-a-method-in-java |
15:39 |
|
pdurbin |
I'm playing around with simply returning strings... i.e. "successfully indexed file 42 into Solr" |
15:40 |
|
sfisque |
strings 1) arent' portable 2) more subject to human error 3) make horrible "keys" performance-wise |
15:40 |
|
sfisque |
one of the few times i'd say an enum is better that has both a code and msg attributes |
15:43 |
|
pdurbin |
and the message could be localized/internationalized |
15:44 |
|
* sfisque |
nods |
15:47 |
|
sfisque |
and if the value gets dumped over the network, you can just send the code, and let the client consume it however they want (they can use their own strings or react how they want) |
15:57 |
|
pdurbin |
yeah |
15:58 |
|
pdurbin |
the thing is... I'm trying to couple the indexing operation with the save operation. if a file is updated, I want it to be reindexed. so within save() I do an index() |
15:58 |
|
pdurbin |
and my index() returns a string with status... "success!" vs. "solr is down!" |
15:59 |
|
pdurbin |
but the save() method returns an object (a Datafile object in this case) ... so I have nowhere to put the string from my index() method |
16:00 |
|
sfisque |
wrapper object |
16:00 |
|
pdurbin |
yeah |
16:00 |
|
sfisque |
or the ever hacky transient field in the returned object |
16:00 |
|
pdurbin |
save() should return a wrapper object |
16:00 |
|
sfisque |
or throw an exception |
16:00 |
|
pdurbin |
bleh... no transient field |
16:00 |
|
sfisque |
this sounds like an exceptional case. if solr is down, that's a problem, no? |
16:01 |
|
pdurbin |
hmm |
16:01 |
|
pdurbin |
it is a problem :) |
16:01 |
|
pdurbin |
would be a problem |
16:01 |
|
sfisque |
then keep it all the same, and throw an exception |
16:02 |
|
sfisque |
you can put the string in the message atribute of the exception |
16:02 |
|
pdurbin |
sure |
16:03 |
|
pdurbin |
but if I want to communicate success (the id of something that was indexed)... that's when I'd go with a wrapper object approach... having save() return a wrapper object |
16:03 |
|
pdurbin |
that can communicate various status of methods (like index) called within save() |
16:05 |
|
sfisque |
that's somethign internal to the object. make a method and add a transient field. |
16:06 |
|
sfisque |
basically it would be considered "state" but not requiring persistence. |
16:06 |
|
sfisque |
OR, subclass the entity, and have the subclass contain any transient state vars with accessors, and have a constructor that takes the base class type as a parameter with the various state attributes (assuming you dont' want them externally mutable) |
16:07 |
|
sfisque |
anywho, off to take the spawnlings to school. be well and code strong! |
16:07 |
|
pdurbin |
:) |
16:07 |
|
pdurbin |
sfisque: thanks |
16:46 |
|
|
neuro_sys joined ##javaee |
16:47 |
|
* firebird1 |
going out |
18:18 |
|
|
sheenobu joined ##javaee |
19:39 |
|
|
deksterdotfa joined ##javaee |
19:41 |
|
|
deksterdotfa left ##javaee |
20:12 |
|
|
kotten joined ##javaee |
20:58 |
|
|
tommmied1 joined ##javaee |
21:01 |
|
firebird1 |
so spring is all about DI ? |
21:09 |
|
whartung |
originally it was firebird1, that's now more a means to an end for spring |
21:11 |
|
sfisque |
and that end….. the de-evolution of the software industry into low paid monkeys typing furiously at a million keyboards |
21:12 |
|
whartung |
Shakespearean software |
21:12 |
|
sfisque |
lolz |
21:26 |
|
firebird1 |
i made serialVersionUID 1L for all my classes it works fine :) |
21:28 |
|
sfisque |
you can even omit it unless the class is getting de/serialized (EJBs, objects dumped/read to/from ObjectStream, exported to SOAP/RPC/etc.) |
21:29 |
|
sfisque |
it's only important if the object gets de/serialized |
21:29 |
|
sfisque |
and teh actual value is immaterial. what's important is if the non-transient profile of the class changes, you need to change the UID |
21:31 |
|
firebird1 |
JSF asks to serialize the beans |
21:32 |
|
|
syncsys joined ##javaee |
21:32 |
|
syncsys |
hi |
21:32 |
|
syncsys |
Is there something wrong with the hibernate based dao, on highlighted lines in http://pastie.org/8640351#13-14 ? |
21:36 |
|
sfisque |
is your ide reporting an error? |
21:37 |
|
syncsys |
no |
21:41 |
|
sfisque |
then, clarify what the "something wrong" is? is there an issue at runtime? |
21:42 |
|
syncsys |
1 - why not use session.load(Type.class, id); instead? 2 - the excepton looks just fishy. is it a good practice? |
21:43 |
|
sfisque |
depends, is id the PK? |
21:44 |
|
syncsys |
yes |
21:44 |
|
sfisque |
if id is the PK, then yes, your assertion would be correct |
21:44 |
|
syncsys |
the id was @Id annotated |
21:45 |
|
sfisque |
then yah, the method is overkill with lots of unnecessary code |
21:45 |
|
syncsys |
hm |
21:45 |
|
syncsys |
ok |
21:45 |
|
sfisque |
though, the issue is, does .load() throw an exception if there is no object to return? |
21:46 |
|
syncsys |
you ever used .load()? |
21:46 |
|
sfisque |
or does it return null? |
21:46 |
|
sfisque |
i use JPA, i dont waste my time with raw ORM calls |
21:46 |
|
sfisque |
i havent used hibernate natively in over 6 years |
21:49 |
|
sfisque |
pdurbin does neo4j have a jca/jdbc style driver for an EE container? i've not had a chance to explore it deeper than reading through it's capabilities and looking at the Cipher language. i'm curious if anyone has wrapped JPA around it |
21:51 |
|
syncsys |
Class myClassEntity = session.load(myclassEntity.class, id); if(myClassEntity != null) {return myClassEntity; } |
21:52 |
|
syncsys |
I use JPA too |
21:53 |
|
sfisque |
right but 1) does session.load() throw an exception if that pk does not map to an existing entity or does it return null. second, if it does return null, what are you going to return on ! null? |
21:53 |
|
sfisque |
*** return for null case |
21:54 |
|
syncsys |
I would use not session but entity manager |
21:54 |
|
syncsys |
try { MyClass entity=entityManager.load(MyClass.class, id); return entity; } catch(HibernateException he) { /* handle nonexistence */ } |
21:55 |
|
pdurbin |
sfisque: I'm curious too |
22:04 |
|
|
Naros left ##javaee |
22:06 |
|
syncsys |
sfisque, http://pastie.org/8640434 |
22:06 |
|
sfisque |
since you're initializing b to null, unless you're throwing an exception, you can toss the null test and just return b directly |
22:07 |
|
syncsys |
return b directly in finally block? |
22:07 |
|
syncsys |
sfisque, whats the best approach? can you paste? |
22:07 |
|
syncsys |
or on pastie.org ? |
22:08 |
|
sfisque |
also, putting a return in a finally clause is dicey. there are some wierd side effects that can happen. just put return b; at the bottom, get rid of the finally, also, log the exception. printStackTrace isnt guaranteed to work in a contained environment. |
22:08 |
|
syncsys |
well if exception occures. the b wont be return if its at bottom. |
22:08 |
|
syncsys |
can you edit that paste? |
22:08 |
|
syncsys |
to be clear? |
22:09 |
|
sfisque |
Boards b = null; |
22:09 |
|
sfisque |
try |
22:09 |
|
sfisque |
{ |
22:09 |
|
sfisque |
b=entityManager.find(Boards.class, id); |
22:09 |
|
sfisque |
|
22:09 |
|
sfisque |
}catch (IllegalArgumentException e){ |
22:09 |
|
sfisque |
LOGGER.severe( e ); |
22:09 |
|
sfisque |
} |
22:09 |
|
sfisque |
return b; |
22:09 |
|
sfisque |
} |
22:09 |
|
sfisque |
assuming this is an EJB, you dont have to catch RTE, they will be wrapped as EJBEx's and bubbled up |
22:10 |
|
syncsys |
return b; is after the catch block? |
22:10 |
|
syncsys |
ok |
22:10 |
|
sfisque |
the magic happens when you learn to write less code, not more :-D |
22:10 |
|
syncsys |
ya. thanks! |
22:10 |
|
syncsys |
greate |