- This topic has 5 replies, 2 voices, and was last updated 13 years, 4 months ago by
cconway.
-
AuthorPosts
-
John SimsMemberI’ve been developing Java/Servlet web apps for several years using myecipse. I purchased ME4S because of the time-saving promise. I’ve gone through the webinars (a few of them) and can click my way through a simple scaffolding example using a simple data model. I have a new web application to develop and have completed the data model. It’s a very simple data model as data models go. There are a few parent/child relationships and a relationship entity. One of the tables has four parents. A few of the parents also have parents. How do I approach this? Where do I start? Should I use the scaffolding feature to build one piece at a time. Do I start with the interface? I need to build a flexible search screen that allows the user to search on multiple fields/parents. It seems that you really need to understand all of the components used in ME4S to even begin to know where to start. Is there a road-map and/or architecture diagram that explains how all of the pieces fit together. A more comprehensive example captured in a few youtube videos would be very useful. For example, have the developer actually go back and tweak the interface or build a new screen using some of the generated artifacts. Have the developer brand the generated code using sitemesh (e.g. replace a few of the logos).
thanks in advance for any pointers
Attachments:
You must be logged in to view attached files.
cconwayMemberHi Freestyle,
Typically you would start by scaffolding all layers from your data model with the understanding that the user interface will be used for example purposes. The interface should work, but usually the needs of your project are more specific anything that can be generated. Use the JSP pages for examples of how to create lists, forms, etc.
Beyond the videos, there are several tutorials on the myeclipse site under the MyEclipse for Spring heading on this page: http://myeclipseide.com/module-htmlpages-display-pid-7.html. Specifically, take a look at the “Spring MVC 3.0 Scaffolding Tutorial”. It may have some of the information you’re looking for.
Also, the architecture is Spring MVC so any Spring MVC documentation would help you further understand the pieces that are generated.
If you have specific questions, feel free to post them on the forums and we can do our best to answer them.
John SimsMemberFrom scratch: I used Spring MVC scaffolding to create a project to edit one table (Types) in the attached data model. It worked fine until I scaffolded security. I get the login page but get the following error after entering a userid and password (using in-memory model).
I’m running this as a myeclipse server app and the error is displayed in the myeclipse web browser:
HTTP Status 404 – /DNAT%20Using%20Spring%20Scaffolding/j_spring_security_check
——————————————————————————–
type Status reportmessage /DNAT%20Using%20Spring%20Scaffolding/j_spring_security_check
description The requested resource (/DNAT%20Using%20Spring%20Scaffolding/j_spring_security_check) is not available.
——————————————————————————–
Apache Tomcat/6.0.13Any ideas?
cconwayMemberI haven’t seen that error before, but it sounds like either something hasn’t been deployed or the Spring Security configuration is missing from the project.
If you haven’t already done so, please stop your tomcat server and re-build your application using the menubar option: Project > Clean. Then re-start Tomcat and try again.
If that doesn’t fix the problem, please verify that your web.xml has the necessary security components (these should have been added by the Security Scaffolding):
1. A filter named SpringSecuritySessionIntegrationFilter
2. A filter named springSecurityFilterChain
3. A filter-mapping named SpringSecuritySessionIntegrationFilter with url-pattern of /*
4. A filter-mapping named springSecurityFilterChain with url-pattern of /*If those are present, please post the content of your <projectname>-security-context.xml file.
John SimsMemberI tried Clean … and checked the web.xml file – all four security components are there.
Here’s the <projectname>-security-context.xml:
<?xml version=”1.0″ encoding=”UTF-8″?>
<beans:beans xmlns=”http://www.springframework.org/schema/security”
xmlns:beans=”http://www.springframework.org/schema/beans”
xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”
xmlns:context=”http://www.springframework.org/schema/context”
xmlns:lang=”http://www.springframework.org/schema/lang”
xsi:schemaLocation=”http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd”><http auto-config=”true” >
<intercept-url pattern=’/pages/login.jsp’ />
<intercept-url pattern=”/secure/*” access=”IS_AUTHENTICATED_REMEMBERED” />
<form-login login-page=”/pages/login.jsp” authentication-failure-url=”/pages/login.jsp?login_error=true” />
<logout logout-success-url=”/pages/logout-redirect.jsp” invalidate-session=”true” />
</http><authentication-manager alias=”authenticationManager” >
<authentication-provider>
<password-encoder hash=”plaintext”/>
<user-service>
<user name=”admin” password=”admin” authorities=”ROLE_ADMIN”/>
<user name=”user” password=”user” authorities=”ROLE_USER”/>
</user-service>
</authentication-provider>
</authentication-manager><!– ******************************************************************** –>
<!– Apply security for all beans where security was set –>
<!– ******************************************************************** –>
<global-method-security >
<protect-pointcut expression=”execution(* dnat.service.TypesService.*(..))” access=”IS_AUTHENTICATED_REMEMBERED”/>
<protect-pointcut expression=”execution(* dnat.dao.TypesDAO.*(..))” access=”IS_AUTHENTICATED_REMEMBERED”/>
</global-method-security>
</beans:beans>
cconwayMemberWell, that config file looks fine.
Have you checked the server console for an error message either during deployment or during the authentication attempt?
Another thing you can do is in the Servers tab, right-click on the application name under the Tomcat Server Connector and select “Browse Deployment Location”. In the deployment you should see the <projectname>-security-context.xml file under <projectroot>WEB-INF/classes.
Also, under that deployment location, verify that directly under your project root is a folder named “pages” that has a login.jsp, logout-redirect.jsp and logout-success.jsp.
-
AuthorPosts