Time |
S |
Nick |
Message |
00:40 |
|
|
Quest joined ##javaee |
00:55 |
|
Quest |
I am getting /WEB-INF/view/jsp/common/login/login.jsp (line: 8, column: 1) File "${mainDir}/common/header.jsp" not found in login.jsp but I have included <%@include file="../variables.jsp" %> which has <c:set var="mainDir" value="${pageContext.request.contextPath}/view/jsp" /> |
00:55 |
|
Quest |
line 8 is <%@include file="${mainDir}/common/header.jsp" %> |
01:26 |
|
pdurbin |
"Over the past months we evolved from a single gigantic Ruby on Rails application to a network of loosely coupled services built in Java, Scala, Clojure and other languages" -- http://jdc2013.egjug.org/session/moving_away_monolithic_ruby_rails_app_jvm |
01:27 |
|
|
sfisque joined ##javaee |
01:27 |
|
sfisque |
so building openjdk for macosx 10.6 so i can have java7 finally |
01:34 |
|
Quest |
sfisque, any experience with this kind of thing heres what the problem really was. have posted it for elaboration http://stackoverflow.com/questions/18038955/pagecontext-request-contextpath-and-generic-linking |
01:37 |
|
pdurbin |
sfisque: how much effort to build openjdk? I've only ever installed the binary version |
01:55 |
|
sfisque |
binary doesn't exist for 10.6 (snow leopard). so i have to build it. i had to do some symlink magic to get it to compile but it keeps crapping out. but i'm getting closer to a usable binary |
01:57 |
|
sfisque |
Quest, you will not find /WEB-INF via any container macro |
01:57 |
|
pdurbin |
sfisque: you know this but... you should probably upgrade to 10.8 :) |
01:57 |
|
Quest |
hm |
01:58 |
|
sfisque |
$$$ |
01:58 |
|
Quest |
then why /web-inf works and ${pageContext.req.contextPath} does ? |
01:58 |
|
sfisque |
i JUST upgraded to 10.6 because it was only 19.99. other than J7 newer macos installs dont have any compelling features for me |
01:59 |
|
sfisque |
and worse case i can always build/dev inside of a VM |
02:01 |
|
pdurbin |
sfisque: any modern linux has java 7 if you want to play with it in a vm |
02:02 |
|
sfisque |
i know. slackware does not ship with java (anymore) but it's trivial to install it |
02:02 |
|
sfisque |
if i didnt also need photoshop and some other macos specific apps, i'd just run solaris on my macbook :P |
02:02 |
|
pdurbin |
sfisque: right, right. I forgot you're a slackware guy :) |
02:03 |
|
pdurbin |
sfisque: have you tried http://smartos.org ? |
02:04 |
|
sfisque |
blah my build crapped on. more investigation needed. |
02:05 |
|
sfisque |
pdurbin: interesting but there's a reason i run solaris and slackware. i've never ever subscribed to the "distro of the week" club. if it's not rock solid, time tested and fully vetted, i'm not willing to spend time making it so for my environments. |
02:06 |
|
sfisque |
blah ::free has not been declared |
02:06 |
|
* sfisque |
blows the dust off of his C++ experience... |
02:11 |
|
Quest |
hm |
02:11 |
|
Quest |
sfisque, so any bottom lines what is wrong and how to fix? |
02:12 |
|
|
caverdude joined ##javaee |
02:14 |
|
sfisque |
quest: where is the header.jsp located relative to this file in question? |
02:15 |
|
Quest |
sfisque, I have uploaded a snap of the hierarchy too in my post. http://i.stack.imgur.com/NALet.png |
02:16 |
|
Quest |
sfisque, also observe that variables.jsp include works |
02:17 |
|
Quest |
sfisque, makes sense? |
02:17 |
|
sfisque |
i would say, remove the ${} macro because that is going to prepend the deployment context to the path and you don't want that (your files are all contained inside the same context, so you should NEVER need that in your include paths) [n.b. that variable is primarily for constructing URI's dynamically for redirects, arfifact loads (pdf, image, etc.)] |
02:19 |
|
Quest |
but ${pageContext.request.contextPath}/view/j... is what i have been doing in past. why its not working now? |
02:20 |
|
sfisque |
oh, nm, i thought you were using applicationContext. i have to take a closer look at your example |
02:20 |
|
Quest |
ok |
02:20 |
|
|
SoniEx2|2 joined ##javaee |
02:20 |
|
sfisque |
oh yeah contextPath is the same as applicationContext |
02:21 |
|
sfisque |
the question is where is this file located adn wehre is header.jsp located |
02:22 |
|
Quest |
sfisque, http://i.stack.imgur.com/NALet.png the file opened in code is login.jsp |
02:22 |
|
sfisque |
full paths plx |
02:23 |
|
sfisque |
you don't need the macro. just use "../header.jsp" |
02:23 |
|
Quest |
you can have a look at the left dir hierarchy. login.jsp is at webinf/view/jsp/common/login/login.jsp |
02:23 |
|
sfisque |
yah i see that now |
02:23 |
|
sfisque |
see my prev |
02:24 |
|
Quest |
sfisque, thats what my question is.... 1. I want to be generic with paths so if i move a dir later. all my links wont break. I just change the variables. 2. ${pageContext.request.contextPath}/view/j... is what i have been doing in past. why its not working now? |
02:25 |
|
sfisque |
what's more generic than a simple relative path? |
02:26 |
|
Quest |
relatives are not generic. if i move the common dir to some other. all links will break. but if i make the path in a variable. I just have to change the variable. |
02:26 |
|
Quest |
but here my more emphasis is on 2. |
02:26 |
|
sfisque |
well then you're using the wrong variable for your solution |
02:27 |
|
sfisque |
ServetRequest.ContextPath points to where the app is bound in the container, and has zero connection with the underlying file system |
02:28 |
|
Quest |
hm |
02:28 |
|
sfisque |
ServetRequest.ContextPath is for constructing URI for the client to find artifacts or post forms or ajax. it's not for finding file system artifacts |
02:28 |
|
sfisque |
because the webapp does not know until runtime where it is bound in the container |
02:28 |
|
Quest |
sfisque, so should i make <c:set var="mainDir" value="WEB-INF/view/jsp" /> |
02:28 |
|
sfisque |
that is one solution |
02:29 |
|
Quest |
hm |
02:29 |
|
sfisque |
or have a properties object that stores "global static" variables that can be loaded from a property file |
02:29 |
|
Quest |
will the container having the war file would know this path? |
02:29 |
|
sfisque |
or a property in your web.xml |
02:29 |
|
Quest |
i would stick to the mainDir var |
02:30 |
|
Quest |
will the container having the war file would know this path? |
02:30 |
|
sfisque |
what path? |
02:30 |
|
Quest |
the web-inf thing |
02:31 |
|
|
caverdude joined ##javaee |
02:33 |
|
|
caverdude joined ##javaee |
02:33 |
|
sfisque |
the container knows how to find things inside your war/ear file. if you use a file URI that starts with a /, (e.g. /WEB-INF/blah) it starts looking at the root of the war file. if your path does not start with / it treates it relative to the current file's location |
02:36 |
|
Quest |
hm. |
02:36 |
|
Quest |
ok sfisque I am gving it a try |
02:41 |
|
Quest |
sfisque, in ref to http://i.stack.imgur.com/NALet.png variables.jsp now have <c:set var="mainDir" value="/WEB-INF/view/jsp" /> now <%@include file="${manDir}/common/header.jsp" %> in login.jsp wont work but <%@include file="WEB-INF/view/jsp/common/header.jsp" %> does..... strange. isnt it |
02:42 |
|
sfisque |
you're using a JSP include with a JSTL variable expansion |
02:43 |
|
Quest |
yes. |
02:43 |
|
Quest |
is that a problem? |
02:43 |
|
sfisque |
it can be |
02:43 |
|
Quest |
hm |
02:43 |
|
Quest |
well so there isnt a proper solution? |
02:43 |
|
sfisque |
evaluated at different points |
02:48 |
|
sfisque |
i would recommend use the jstl import directive |
02:49 |
|
Quest |
hm.. what is that? |
02:50 |
|
Quest |
jstl import directive. let me google. never heard of it |
02:50 |
|
sfisque |
you're including jstl/core and you don't know what it provides? |
02:51 |
|
Quest |
well i never used it. |
02:52 |
|
Quest |
c:import you mean? |
02:52 |
|
sfisque |
sure you are. <c:set> is from the jstl/core (note the namespace prefix="c" |
02:53 |
|
Quest |
oh yes. that ofcourse. what i meant that i never used the core:import before |
02:54 |
|
Quest |
<c:import url="${manDir}/common/header.jsp" /> then. |
02:54 |
|
* sfisque |
nods |
03:02 |
|
Quest |
sfisque, looks good! |
03:02 |
|
* sfisque |
nods |
03:02 |
|
Quest |
and I hope I dont need to worry about mappings of images and .css files like. WARNING: No mapping found for HTTP request with URI [/ttmaven/jquery/jquery-ui-1.10.3/themes/base/minified/jquery-ui.min.css] in DispatcherServlet with name 'springDispatcher' |
03:02 |
|
Quest |
Aug 04, 2013 8:04:09 AM org.springframework.web.servlet.DispatcherServlet noHandlerFound |
03:03 |
|
Quest |
sfisque, Thanks!!! you have been such an aid |
03:03 |
|
* sfisque |
grins |
03:03 |
|
sfisque |
npnp |
03:03 |
|
pdurbin |
sfisque: I just mentioned SmartOS because it's based on OpenSolaris |
03:03 |
|
sfisque |
aye. i recognized the "stack" they advertise |
03:03 |
|
Quest |
sfisque, I hope I dont need to worry about mappings of images and .css files ^ |
03:04 |
|
Quest |
as ofcourse. images wont be having mappings. only jsps have in controllers |
03:04 |
|
sfisque |
q: solve one problem at a time as you learn :-) |
03:04 |
|
Quest |
iam very vigourous. thats why I get banned everywhere :) |
03:04 |
|
Quest |
sfisque, thanks again. |
03:04 |
|
sfisque |
npnp |
03:06 |
|
pdurbin |
sfisque: yeah, dtrace and such. zfs |
03:07 |
|
sfisque |
zfs was the big tip off. afaik solaris is the only consumer of zfs "natively" atm (though i understand timemachine might be using zfs under the hood but hides it from the user) |
03:11 |
|
pdurbin |
hmm. I kinda doubt it about time machine. but whatever :) |
03:11 |
|
pdurbin |
sfisque: what about dtrace? is it awesome? |
03:12 |
|
sfisque |
bah. openjdk 7 build is still borked on "snow leopard". guess i can try running a vm and run netbeans and J7 via x11 |
03:12 |
|
sfisque |
dunno, havent used dtrace yet |
03:12 |
|
pdurbin |
ok |
03:12 |
|
pdurbin |
sure, x11 netbeans works fine |
03:14 |
|
sfisque |
oh i know. i run it off my remote vm's. i'm just worried running it via X11 from a "local vm" will suck performance-wise. but i'm willing to try it out |
03:15 |
|
pdurbin |
sfisque: there's always vi ;) |
03:15 |
|
sfisque |
i love vi, but that's for hacking out perl scripts and bourne shell stuff :P |
03:16 |
|
pdurbin |
sure is |
03:17 |
|
Quest |
sfisque, 500 - javax.servlet.ServletException: javax.servlet.jsp.JspException: javax.servlet.ServletException: File "/common/header.jsp" not found for <c:import url="${mainDir}/common/header.jsp" /> |
03:17 |
|
sfisque |
looks like mainDir is not defined |
03:17 |
|
Quest |
<c:set var="mainDir" value="/WEB-INF/view/jsp" /> is defined in variables.jsp (variables.jsp is included fine in the login page before the header.jsp include) |
03:18 |
|
sfisque |
included how? |
03:18 |
|
sfisque |
remember JSP include and jstl execute in different points in the thread. it's generally good to "not cross the streams" :P |
03:19 |
|
Quest |
am.. you mean they are not included step by step? |
03:20 |
|
|
jxriddle joined ##javaee |
03:20 |
|
sfisque |
no. JSP directives are executed by the JSP engine. JSTL directives are handled by the JSTL engine |
03:21 |
|
Quest |
hm. sfisque you are correct. looks like ${mainDir} is not working. though I didnt got an error on the include <c:import url="/WEB-INF/view/jsp/common/variables.jsp" /> |
03:21 |
|
Quest |
sfisque, ok but both of my imports were in jstl engine. so why didnt it worked |
03:23 |
|
sfisque |
you might have to use the "scope" attribute. i think c:set is page scope (the page that it appears in, not the "entire page") |
03:23 |
|
sfisque |
you might have to make it "request" scoped |
03:23 |
|
Quest |
k |
03:23 |
|
sfisque |
page scope, by default |
03:23 |
|
sfisque |
IIRC |
03:24 |
|
pdurbin |
sfisque: nothing ships with java anymore, you know :) |
03:25 |
|
Quest |
Illegal scope attribute without var in "c:import" tag.</p> |
03:25 |
|
Quest |
<c:import url="/WEB-INF/view/jsp/common/variables.jsp" scope="request"/> |
03:26 |
|
Quest |
nevermind... got it. |
03:26 |
|
Quest |
should have done it in <c:set var="mainDir" value="/WEB-INF/view/jsp" scope="request" /> . i just got confused |
03:28 |
|
* pdurbin |
looks at http://en.wikipedia.org/wiki/JavaServer_Pages_Standard_Tag_Library and isn't sure we use JSTL at all in our JSF app... |
03:32 |
|
sfisque |
JSF + JSTL is a rough ride |
03:32 |
|
sfisque |
solaris ships with java :P |
03:33 |
|
sfisque |
talk about "head -> desk" |
03:34 |
|
pdurbin |
oh yeah. I keep forgetting about solaris ;) |
03:35 |
|
* sfisque |
winks |
03:35 |
|
pdurbin |
in the solaris 6 days I didn't really like their package management |
03:35 |
|
Quest |
sfisque, more issues :) . the pageTitle wont show up at login.jsp http://pastebin.com/ucxKAcBt |
03:36 |
|
sfisque |
oh yah, solaris 11 is totally new beast |
03:37 |
|
sfisque |
do you have something bound to the "spring" namespace for the tag to work? |
03:37 |
|
Quest |
sfisque, in the variables.jsp yes. <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> |
03:38 |
|
sfisque |
ok where pageTitle.login defined? |
03:38 |
|
Quest |
in messages.properites. it worked fine untill i did the import soup |
03:44 |
|
Quest |
sfisque, it goes away when I add <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> in the login.jsp but I wonder why |
03:45 |
|
sfisque |
dunno |
03:45 |
|
Quest |
ok |
04:16 |
|
|
caverdude joined ##javaee |
05:05 |
|
|
jxriddle joined ##javaee |
05:19 |
|
sfisque |
nite folks. code strong |
05:20 |
|
|
SoniEx2|2 joined ##javaee |
05:24 |
|
Quest |
sfisque, leaving? |
05:30 |
|
Quest |
any one have any idea about this ? http://stackoverflow.com/questions/18039973/images-scripts-and-resources-link-path-in-jsp-while-using-spring |
07:24 |
|
|
caverdude joined ##javaee |
08:03 |
|
* SoniEx2 |
hugs sfisque in an overly cute way ^-^ |
08:03 |
|
SoniEx2 |
good night |
10:26 |
|
|
buharin joined ##javaee |
10:35 |
|
buharin |
hey |
10:36 |
|
buharin |
someone can help with maven glassfish integration? |
11:20 |
|
|
SoniEx2|2 joined ##javaee |
13:27 |
|
|
caverdude joined ##javaee |
14:20 |
|
|
SoniEx2 joined ##javaee |
14:25 |
|
|
joshua_jandyco joined ##javaee |
16:43 |
|
|
joshua_jandyco joined ##javaee |
17:20 |
|
|
SoniEx2|2 joined ##javaee |
19:31 |
|
|
babaj joined ##javaee |
19:47 |
|
|
SoniEx2 joined ##javaee |
20:08 |
|
|
kobain joined ##javaee |
20:20 |
|
|
SoniEx2|2 joined ##javaee |
20:49 |
|
|
caverdude joined ##javaee |
21:09 |
|
|
kobain joined ##javaee |
21:10 |
|
|
kobain joined ##javaee |
21:15 |
|
|
kobain joined ##javaee |
22:09 |
|
|
caverdude joined ##javaee |