[Design of JBoss Portal] - Back button problem in portal environment
by Zealot
Hi everyone
I have a conceptual problem with back button in portal environment.
Imagine that we have to pages JSF portlet. Fist page give us list of products and hiperlink for each one. Link walk us to the next page where full information about product displayed. Information about product pass through Session Bean property (Request Bean doesn't work in portal environment for such purpose).
Fist time everything work fine until user press browser back button. When he does it first page show up again and when he press another link he still get page from the first try. And there is no way to see another product pages. I suppose that's can be because of state saving method, but can I change it in portal environment?
If no, what's a method to solve such problem?
I've already tried to ask this question on Sun Portal Forum but I only got answer like as follows:
anonymous wrote : I'm assuming the link contains information uniquely identifying the selection?? When the link is selected, get this information, store in session, and retrieve the session information when in the init() method of the target page. Should work just fine.
I suppose it wouldn't work in portal environment because url is something that portal use for it's needs.
http://forum.java.sun.com/thread.jspa?threadID=5131855&tstart=0
Thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4011351#4011351
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4011351
19 years, 2 months
[Design of EJB 3.0] - VirtualFile abstraction
by thomas.diesler@jboss.com
Carlo,
I notice with the latest EJB3 backport to jboss42 there are a lot referrences to VirtualFile commented out. This is of course correct because jboss-vfs.jar cannot be used in jboss42.
In jbossws we have a simmilar problem in our integration layers for the varios containers, wich we solved by introducing an UnifiedVirtualFile
| /**
| * An adaptor to a VirtualFile from jboss-vfs.jar
| * jboss-vfs cannot be used in jboss-4.x because of its dependeny on jboss-common-core.jar
| *
| * @author Thomas.Diesler(a)jboss.org
| * @since 05-May-2006
| */
| public interface UnifiedVirtualFile extends Serializable
| {
| UnifiedVirtualFile findChild(String child) throws IOException;
|
| URL toURL();
| }
|
It turns out that we only need these two methods to find and read resources. There is a trivial implementation for jboss50 that delegates to a VirtualFile
| /**
| * A JBoss50 VirtualFile adaptor
| *
| * @author Thomas.Diesler(a)jboss.org
| * @since 05-May-2006
| */
| public class VirtualFileAdaptor implements UnifiedVirtualFile
| {
| private static final long serialVersionUID = 6547394037548338042L;
|
| private VirtualFile root;
|
| public VirtualFileAdaptor(VirtualFile root)
| {
| this.root = root;
| }
|
| public UnifiedVirtualFile findChild(String child) throws IOException
| {
| VirtualFile vf = root.findChild(child);
| return new VirtualFileAdaptor(vf);
| }
|
| public URL toURL()
| {
| try
| {
| return root.toURL();
| }
| catch (Exception e)
| {
| return null;
| }
| }
| }
|
and one for jboss42 that uses a resource class loader
| /**
| * The default file adapter loads resources through an associated classloader.
| * If no classload is set, the the thread context classloader will be used.
| *
| * @author Heiko.Braun(a)jboss.org
| * @since 25.01.2007
| */
| public class ResourceLoaderAdapter implements UnifiedVirtualFile
| {
| private URL resourceURL;
| private ClassLoader loader;
|
| public ResourceLoaderAdapter()
| {
| this(Thread.currentThread().getContextClassLoader());
| }
|
| public ResourceLoaderAdapter(ClassLoader loader)
| {
| this.loader = loader;
| }
|
| private ResourceLoaderAdapter(ClassLoader loader, URL resourceURL)
| {
| this.resourceURL = resourceURL;
| this.loader = loader;
| }
|
| public UnifiedVirtualFile findChild(String resourcePath) throws IOException
| {
| URL resourceURL = null;
| if (resourcePath != null)
| {
| // Try the child as URL
| try
| {
| resourceURL = new URL(resourcePath);
| }
| catch (MalformedURLException ex)
| {
| // ignore
| }
|
| // Try the filename as File
| if (resourceURL == null)
| {
| try
| {
| File file = new File(resourcePath);
| if (file.exists())
| resourceURL = file.toURL();
| }
| catch (MalformedURLException e)
| {
| // ignore
| }
| }
|
| // Try the filename as Resource
| if (resourceURL == null)
| {
| try
| {
| resourceURL = loader.getResource(resourcePath);
| }
| catch (Exception ex)
| {
| // ignore
| }
| }
| }
|
| if (resourceURL == null)
| throw new IOException("Cannot get URL for: " + resourcePath);
|
| return new ResourceLoaderAdapter(loader, resourceURL);
| }
|
| public URL toURL()
| {
| if (null == this.resourceURL)
| throw new IllegalStateException("UnifiedVirtualFile not initialized");
| return resourceURL;
| }
| }
|
Maybe this would solve your abstraction problem as well.
cheers
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4011342#4011342
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4011342
19 years, 2 months
[Design of JBoss Portal] - Map collection mapping giving problem
by saha.saptarshi
Hi,
I have add a map to hibernate "FormTabMetaData" class map file. As a result now the class is not fatching any record.I am adding coding here.Any help will be cherished.
There are three tables:
FormTabMetaData--
1.1 tabid
1.2 fieldid
1.3 name
------------
FormFieldMetaData--
2.1 fieldid
2.2 name
2.3 attrbtid
------------
AttributeRight--
3.1 attrbtid
3.2 name
The map code is:
<map name="visibleAttributes" table="formFieldMetaData" lazy="true" >
| <key column="idFormTabMetaData"/>
| <index column="idFormFieldMetaData" type="java.lang.Long" >
| </index>
| <composite-element class="com.eforce.license.licensemanager.transferobject.AttributeRight">
| <parent name="formFieldMetaData"/>
| <property name="name" column="idAttributePermission" type="java.lang.Long" not-null="true"/>
| </composite-element>
| <filter name="Deleted" />
| </map>
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4011310#4011310
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4011310
19 years, 2 months