-
1. Re: Page action not called
sammy8306 May 31, 2007 3:46 AM (in response to sammy8306)Anyone got a hint? I really need this to work, to keep my implementation manageable...
-
2. Re: Page action not called
gavin.king May 31, 2007 3:52 AM (in response to sammy8306)Put the Seam src in your sourcepath and use your debugger. (Put a breakpoint in the Pages class.)
I'm sure you'll quickly find the problem. -
3. Re: Page action not called
sammy8306 May 31, 2007 5:11 AM (in response to sammy8306)So you're saying what I am doing should work, or are you saying that it won't work (for some reason, to be found in the Pages class)?
-
4. Re: Page action not called
gavin.king May 31, 2007 12:15 PM (in response to sammy8306)Sure, it looks about right.
-
5. Re: Page action not called
sammy8306 Jul 26, 2007 9:48 AM (in response to sammy8306)I decided to look into this again, since I would really like this to work. First step was to put the log4J level at debug, since there are several debug statements in Pages.java (e.g. log.debug("reading pages.xml");). And lo and behold, these messages do not even appear in the debug output. Does this mean Seam isn't parsing my pages.xml? (it must be, since directives in pages.xml are followed, only in *.page.xml they are ignored)...
-
6. Re: Page action not called
sammy8306 Jul 26, 2007 9:57 AM (in response to sammy8306)Ok, figured out why the debug statement didn't appear, parsing pages only happens when a request is handled, not at startup. Original question still stands though. I've tried to move the *.page.xml to the WEB-INF directory, but no success.
-
7. Re: Page action not called
sammy8306 Jul 26, 2007 10:57 AM (in response to sammy8306)(I'll keep talking to myself :-), since I think it might be useful for others too)
minor breakthrough: the resource loading seems to be the culprit. Pages.java strips the leading slash of the view id, replaces its extension with .page.xml and delegates to Resources.getResourceAsStream(), which fails all its options to load the file. However, if I prepend "/WEB-INF" to the resource string used in Pages.java, it works (of course the *.page.xml files need to be present in this dir)!!
However, I would rather not use my own patched version of Seam. Why aren't the files loaded when they are in the root of the webapp, along with the facelets .xhtml files? -
8. Re: Page action not called
wise_guybg Jul 26, 2007 12:04 PM (in response to sammy8306)*.page.xml should be next to your xhtml file.
I have :
\AuthProject\AuthWebApp\resources\noauth\login.page.xml
\AuthProject\AuthWebApp\resources\noauth\login.xhtml -
9. Re: Page action not called
sammy8306 Jul 26, 2007 1:25 PM (in response to sammy8306)"wise_guybg" wrote:
*.page.xml should be next to your xhtml file.
That's what I thought too, but apparently that doesn't work, at least if the xhtml/page.xml files are in the root of the WAR.
The structure is your source structure I presume, what is the layout of the generated WAR? -
10. Re: Page action not called
sammy8306 Jul 30, 2007 2:19 AM (in response to sammy8306)Is there anybody with more insight into the Seam codebase who can comment on this issue? Very strange.
-
11. Re: Page action not called
wise_guybg Jul 30, 2007 5:38 AM (in response to sammy8306)Well this would be:
\AuthWebApp.war\noauth\login.page.xml
\AuthWebApp.war\noauth\login.xhtml
I think you should place the page.xml files next to the xhtml. You should determine what's wrong in your configuration.
You can debug the Pages.java to see what is wrong. See Pages.createPage() -
12. Re: Page action not called
sammy8306 Jul 30, 2007 7:27 AM (in response to sammy8306)"wise_guybg" wrote:
Well this would be:
\AuthWebApp.war\noauth\login.page.xml
\AuthWebApp.war\noauth\login.xhtml
Right, so your view pages are not in the root of the war (as they are in some of the Seam example apps), I'm speculating that might be part of the problem.
I think you should place the page.xml files next to the xhtml.
Yup, that's what I initially had:
\WebApp.war\Foo.xhtml
\WebApp.war\Foo.page.xml
No succes.
You should determine what's wrong in your configuration.
You can debug the Pages.java to see what is wrong. See Pages.createPage()
Yeah, that's what I described in the previous posts. The debugging showed that Pages.java tries to load Foo.page.xml, but Resources.java fails loading it (it has several strategies to load external resources which all fail). It does work when I patch Pages.java to search for the files in /WEB-INF explicitly (as it does to lookup pages.xml). But, that's not really a solution since I'd have to run a patched version of Seam. I'm just stumped that the page.xml files cannot be loaded when they are in the root of the webapp, alongside the xhtml files.
Thanks for your help though!
Oh, one more thought: may be my servlet container precludes access to these files? Though facelets can freely load the xhtml files in the same location, so I doubt it... -
13. Re: Page action not called
wise_guybg Jul 30, 2007 8:14 AM (in response to sammy8306)Apart making modifications to the Pages class, have you tried putting a .xhtml and a .page.xml in a folder inside the root. Like my "noauth". Just to be sure that you have exactly localized the problem. If this works and putting them in root doesn't then I consider this a bug.
I have tested the opposite, on my deploy. Seam correctly found AuthWebApp.war\error.page.xml in my root folder. It was processed by the Pages class.
What version of Seam are you actually using? Mine is 2.0.0.BETA1. -
14. Re: Page action not called
wise_guybg Jul 30, 2007 8:18 AM (in response to sammy8306)Do not consider /WEB-INF as a repository for the *.page.xml As you have probably seen the Pages class gets the configuration file's name like this
String resourceName = replaceExtension(viewId, ".page.xml");
It should really be next to the .xhtml file. After all this is the idea behind this feature, to have the configuration next to the source file. Not in a single really big repository location.