-
FEATURED COMPONENTS
First time here? Check out the FAQ!
hi all
Can anybody let me know the project structure zk
where i put tld field, context.xml and the other filed
thx for help
There are a lot of sample projects in the small talks that you can use as guidelines.
Read this smalltalk first:http://docs.zkoss.org/wiki/QuickStart_Guide#Running_the_sample_application_with_an_IDE
Here are all the smalltalks: http://docs.zkoss.org/wiki/Small_Talks
Hi saad,
The correct deployment structure for each feature is documented by each provider of that feature. I'm afraid there's no one-shot guide that covers everything.
You have to search for user guide of each of the things you want to add into your application.
Regards,
Simon
If you use Spring/JPA/Hibernate you can create a ZetaForm (new/other/zk/zeta). You'll get a full configured and running project including i.e. zk.xml.
I do not use the zeta-form, but i use it onetime (dummy) to setup my project.
After this, you could simple annotatie (@) your resources and use spring-injects, transactioncontroll....
Note: You need to edit the application-context.xml to add your packages for spring-injections.
i.e.
<zksp-annot:component-scan base-package="org.zkoss.spring.jpa,your.root.package"/>
/Robert
Hi,
ZetaForms are a part of the ZK Studio for Eclipse (there is also a tool for Netbeans).
1) Setup Eclipse
Install Java JDK
Install Tomcat
Configure Tomcat inside Eclipse
See this link for details.
2.) Setup ZK Studio
See this link for details.
If you only need a new ZK Project - create new Projekt ZK (but you have to configure Spring yourself).
3.) Prepare your first zetaform
3a) Database
Configure your database inside the "Data Source Explorer" - check this example for MySQL.
Note you need a JDBC-Driver for correct setup.
4.) Execute your first zeta-form
Check this and this.
Now you have an simple CRUD for one table and is Spring/JPA/Hibernate/ZK is ready.
Here some simple Spring examples:
Annotate your controllers like this: (make sure that your package is inside the scan-path from the application-context.xml)
@Repository("mainController") @Scope("prototype") public class Main extends GenericForwardComposer {
and use it in your zul like that:
.. <?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?> ... <window id="win" border="normal" apply="${mainController}" width="970px">
Your controller is now Spring managed, you can scope your resources as singleton (i.e. a list of logged users, configs, ServiceLayer) or session (i.e. userdata after login) or inject JDBC-connections, hibernate session or better JPA transactions.
/Robert
Asked: 2010-04-09 05:43:37 +0800
Seen: 316 times
Last updated: Apr 13 '10