Don Blodgett

Ranch Hand
+ Follow
since Jan 09, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Don Blodgett

Paul Clapham wrote:Here's an example. The namespace URI for XSLT is http://www.w3.org/1999/XSL/Transform. That's defined in this document: XSL Transformations (XSLT) Version 1.0. You'll notice that in section 2.1 of the document, the namespace URI is specified.



Thank you, that clears up a lot. Basically it is up to the implementation to determine how it is going to verify that the namespace is followed according to the specification.

Paul Clapham wrote:Yes, it's important. It doesn't follow that it must be stored somewhere.



I agree with what you are saying, "stored" is not really the correct word here, but it certainly is defined in a specification which is stored somewhere. I guess my question is not really where this specification for JSF is, but generally where would an XML namespace be defined? Is it a DTD or XSD? If so how do those define the namespace they are defining? Or is it more complex than that? For example, with JSF I am assuming that it has to do with tag libs which I would imagine are all contained in the JAR files for the different JSF libraries. Am I on the right track here?
I have a fairly good understanding of how namespaces work when used in an XML document, what I don't understand is where the URI comes from or how my IDE for example knows what elements are associated with that namespace. For example, in a JSF file you can refer to the core JSF namespace by using the following, and that the alias "f" could be pretty much anything I would like, but the URI must be "http://java.sun.com/jsf/core" otherwise my IDE doesn't know what those elements are and when the JSF is being processed will cause it to fail.



So obviously, the URI is important and it must be stored somewhere, but where?

I understand that the URI is not a URL, it doesn't necessarily point to a resource as it is not a Universal Resource Locator but instead a Universal Resource Identifier. My question is where is the URI actually defined and where are the elements that make up the namespace defined?
Is there a way of getting a list of named groups in a regular expression without knowing those names ahead of time other than parsing the regular expression to look for the named capture groups? It would be very simple to do that, but I feel that I would be doing something that is already easily at hand, or should be.
12 years ago
Thanks for your reply Tim. I changed the xhtml to jsf, but unfortunately the same problem occurs. Also I think that I should point out that the application I am working on, all the URLs that are sent by the client end with xhtml. Not entirely sure why that is, but it renders the pages correctly, including all of the jsf processed tags. On the other hand, if the pages are requested ending with jsf, the resources (css, images, javascript) produce 404 errors. In both cases, if I attempt to access restricted pages it correctly redirects to the signin page, unless the current session already has an authorized principal, which is then correctly allowing access to the page. As for the URLs ending with xhtml, that is not specified, instead only the view Id is provided, for example:



12 years ago
JSF
When the user enters their login information on the signin page, based on their permission would determine if they are sent to the admin page or the content page. When a user that doesn't have admin permission logs in they are successfully directed to the content page, but when an admin user logs in the signin page is refreshed instead of directing them to the admin page. If the admin user manually goes to the admin page by typing the path directly in the address bar, after signon, the page is displayed correctly.

The signon method that is called from the signin page returns either "admin" or "content".

I thought that it may be an issue with the directory structure. So I created a navigation-rule in faces-config.xml that looks like this.



Unfortunately that did not solve the problem. I was wondering what I am missing here?

I have a directory structure that looks like this



I appreciate any help on this, thanks.
12 years ago
JSF
Tim, thank you for your response. You were right I did call the invalidate method, although not the one that I had posted. Anyway you lead me down the path to finding the issue.
12 years ago
JSF
I am using JSF 2.0 with JBoss AS 7. I am attempting to use a session to store some user related information, but the session is somehow being cleared after the first access of the session.

When accessing the session, I use the following contained in the Post Construct of a Session Scoped bean:



When a fresh user navigates to the site the session is null as expected. As a result they are prompted to enter in some information which creates a new session, also contained in a Session Scoped bean, as follows:



The user is then redirected to the outcome page and the session map is accessed as above, this time the session is not null as expected and contains the data as entered. When the user navigates to any other page the session again is null when attempting to access it, even though the JSESSIONID is the same in both cases.

Thanks for any advice on this issue.
12 years ago
JSF
I have the following classes, MyModel is set into MyAction through the use of Spring:





When I pass as a parameter the following, the newValues Map in MyModel is null:



If I pass the parameter as the following, the newValues Map in MyModel has the key/value pair of 12345=ABCDE:



The only difference is that in the non-working parameter I have a dash in the key and the working parameter I do not have the dash in the key.

The dash is important to have as it is part of the unique Id for this process.

I have found another way of doing this by creating a list of custom model classes that has a key and value field, but I am still wondering why a Map will not work for this case.
13 years ago
I have a problem populating a parameter to a Map<String, String>. I have the following parameter that does not get placed in the newValue within my model which has a getter and setter for newValue:

newValue['1234-5'] = ABCDE

But if I have the following it works:

newValue['12345'] = ABCDE

I am wondering why it does not populate the map when I have a dash?
13 years ago
I managed to figure out a solution to this problem, not one that I particularly like, but it works. I created a sql-query that is basically the same as the query that Hibernate creates, but I replaced the case statement with my own case statement and eliminated a few of the redundant joins and it is working now.
I am trying to get a mapping to work correctly, it is persisting correctly but it is not selecting correctly. My class hierarchy is as follows:

Person
--AffiliatedPerson
----AffiliatedUser
------AffiliatedUserPlayer
--------AffiliatedUserPlayerCoach
------AffiliatedUserCoach
----AffiliatedPlayer
------AffiliatedPlayerCoach
----AffiliatedCoach

When I save the object regardless of what class I save, it is persisted to the database correctly, but when I select an object that is supposed to be, for example, AffiliatedPlayerCoach I instead get an instance of AffiliatedCoach. In the select query, I see the following which looks to me is Hibernate attempting to determine the class to instantiate:



By looking at this I can understand that the reason I am getting an instance of AffiliatedCoach instead of AffiliatedPlayerCoach, because the first "when" would be true and so it would return 8 which I assume is being used as the index of all sub-classes in the mapping. I guess my question is, is there any way to have Hibernate use a different case statement for this, or have it check all 8 cases rather than just 5? The way I would see a proper case statement for this situation is as follows:




Any help is greatly appreciated.
I have managed to find a solution that works for me. For those that are interested see the following. Basically what I did was wrap my DAO bean in an org.springframework.transaction.interceptor.TransactionProxyFactoryBean.



Are there any suggestions on this? I am completely lost as to why this is not working. I have a transaction manager defined in my application context using the following, but I am not sure where I should be using the transactionManager bean.



If I take it out I get an error indicating that there must be one, but I am not using it anywhere else, so I assume that it is being used internally by Spring. Not sure why it is null when it gets to the org.springframework.jdbc.support.lob.LobCreatorUtils.registerTransactionSynchronization method, as I understand it this transactionManager bean should be used to maintain the transaction while the Spring LOB handler commits the LOB to the database. There has to be something (likely small) that I am missing, I appreciate any help on this.
I am attempting to save an entity which has a custom UserType to handle a Blob field. If I comment out the property for the Blob from the Hibernate mapping file I am able to save the entity just fine. I know that there must be something very small that is not correct. The code worked previously and was able to save the entity with the Blob just fine, unfortunately I am not able to find what could have changed to cause this problem. The following is a stack trace of the exception, any help is appricated.