[JBoss Seam] - Navigation, Menu, Sitemap -> Content Management
by patrickr
Many web sites consist of pages that can be hierarchically structured. The main menu often reflects this structure, hiding child nodes until the user clicks a menu item (or a node in a tree view). A sitemap instead could display all child nodes (or at least nodes with a level i.e. <= 3).
But how do we get/define these navigation nodes? As mentioned before, nodes basically represent pages. Since we already define pages in Seam pages.xml, I wonder if we could leverage them to be navigation nodes (or something to build a menu / sitemap from). In general, how do you approach dynamic menu and sitemap generation?
Background: I am currently evaluating Seam for use in a scenario, where basic content management is required. So in addition, any experiences, suggestions regarding this are very appreciated.
Regards
Patrick
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4047386#4047386
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4047386
18 years, 11 months
[JBoss AOP] - IllegalAccessException using reflection on private field
by jxhill
I have an app that relies heavily on reflection. I want to use AOP with it, but I get an error when accessing a private variable through java.lang.reflect.Field. It appears that aspects disables the call to Field.setAccessible(); The following sample code works fine until I apply aspects.
| // TestObject.java
| package test;
|
| public class TestObject
| {
| @SuppressWarnings("unused")
| private String testField = "Initial Value";
| }
|
| // TestAspect.java
| package test;
|
| import org.jboss.aop.joinpoint.FieldReadInvocation;
| import org.jboss.aop.joinpoint.FieldWriteInvocation;
|
| public class TestAspect
| {
| public Object accessField(FieldReadInvocation invocation) throws Throwable
| {
| return invocation.invokeNext();
| }
|
| public Object accessField(FieldWriteInvocation invocation) throws Throwable
| {
| return invocation.invokeNext();
| }
| }
|
| // Main.java
| package test;
|
| import java.lang.reflect.Field;
|
| public class Main
| {
| public static void main(String[] args)
| {
| TestObject test = new TestObject();
|
| fieldReadTest(test);
| out("");
| fieldWriteTest(test, "Some new value");
| out("");
| fieldReadTest(test);
| }
|
| public static void fieldWriteTest(TestObject test, Object newValue)
| {
| infoOut("Begin Field Write Test");
|
| try
| {
| Field f = TestObject.class.getDeclaredField("testField");
| f.setAccessible(true);
| f.set(test, newValue);
| infoOut("End Field Write Test - Success")
| ; }
| catch(Exception e)
| {
| out(e);
| infoOut("End Field Write Test - FAILED");
| }
| }
|
| public static void fieldReadTest(TestObject test)
| {
| infoOut("Begin Field Read Test");
|
| try
| {
| Field f = TestObject.class.getDeclaredField("testField");
| f.setAccessible(true);
| System.out.println(String.valueOf(f.get(test)));
| infoOut("End Field Read Test - Success")
| ; }
| catch(Exception e)
| {
| out(e);
| infoOut("End Field Read Test - FAILED");
| }
| }
|
| private static void infoOut(String s)
| {
| System.out.println("[" + s + "]");
| }
|
| private static void out(Object o)
| {
| System.out.println(o.toString());
| }
| }
|
jboss-aop.xml
| <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
| <aop>
| <aspect name="ReflectionAspect" class="org.jboss.aop.reflection.ReflectionAspect" scope="PER_VM"/>
|
| <bind pointcut="call(* java.lang.reflect.Field->get*(..))">
| <advice name="interceptFieldGet" aspect="ReflectionAspect"/>
| </bind>
|
| <bind pointcut="call(* java.lang.reflect.Field->set*(..))">
| <advice name="interceptFieldSet" aspect="ReflectionAspect"/>
| </bind>
|
| <aspect class="test.TestAspect" scope="PER_VM"/>
|
| <bind pointcut="field(* test.TestObject->*)">
| <advice name="accessField" aspect="test.TestAspect"/>
| </bind>
| </aop>
|
Am I doing something wrong, or is this a bug?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4047385#4047385
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4047385
18 years, 11 months
[Installation, Configuration & Deployment] - jboss startup fails
by dreuzel
i Use mysql db latin_1 latin1_general_ci as collating sequence
hrowable while attempting to get a new connection: null
org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: Unknown initial character set index '48' received from server. Initial client character set can be forced via the 'characterEncoding' property.)
at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:179)
at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:565)
at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:250)
at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:491)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4047381#4047381
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4047381
18 years, 11 months