> To export PDF in Java Web/grails, the best solution on the Internet is to use the [flyingsaucer] (https://github.com/flyingsaucerproject/flyingsaucer "flying saucer") Library.
> There are always various problems that can be found on the Internet with the ready-made V8 jar packages, such as bugs in CSS that 'word-wrapp' does not work,
> We need to download all the source code from the GIT homepage of the project and compile it with ** Maven.
Comp
Grails services use Boolean transactional = true to add transactions for each method in the service. The default propagation mode of transactions is propagation. required, readonly = false, cannot be modified. If some methods in the service need read-only transactions, this method cannot meet the requirements. Because the grails service is a bean, you can use spring's Annotation transaction @ transactional
I once had doubts about projects such as xruby jruby. Why does it take time to associate JVM with Ruby? The answer is fast and reusable.
I am more interested in the scripting language. Ruby is my favorite scripting language, followed by JavaScript. I have heard of the groovy scripting language a long time ago, but I have never touched on it. This may be related to my C and C ++ origins. Sometimes, I reject Java and do not care much about Java. (Of course, you still need to learn and use it for
There are multiple ways to implement cascading update. Now we only introduce how to implement it using the Ajax technology of the jquery framework. I personally think that jquery is better and more flexible, because it is only responsible for transmitting data, asynchronous updates provided by grails are simple and complicated.
The following code does not need to consider the business Significance
Ajax Implementation of jquery:
1. Simple code of _ for
Because the controller's name is generally capitalized, such as login at this timeClass Logincontroller {def index = {Redirect (action:Login, Params:params)}def login={}Then there will be an error that cannot be found on the login controller.Note that at this point login should be changed to lowercase beginning as followsClass Logincontroller {def index = {Redirect (action:login, Params:params)}def login={}One possible reason for grails redirect not t
Use SQL statements directly in Grails to query, you can get a new connection directly, or you can use the default data sourceQuery code:ApplicationContextctx= (ApplicationContext) Applicationholder.getapplication (). Getmaincontext () defdatasource =ctx.getbean (' DataSource ') defsql=new SQL (dataSource) StringstrSql= Select*from company "sql.eachrow (strSQL) { printlnit printlnit.id}//Need Guide Pack importgroovy.sql.Sqlimport org.codehaus.groovy.
Working with Groovy while learning grails is unavoidable, though not too deep, but it's also helpful to know a few features.
1. Get integers after dividingUse the intdiv () method to get an integer, note that this method only applies to dividing two integers , floating-point numbers do notIf,while acceptable type of 2.Groovy
Boolean
Number 0 is false, others are true
String null character "" is false, others are true
The obj
Entity entcurr = entcollection. Find (delegate (entity m) {return M. Name = "AA" ;}); objectList ltentity = entcollection. findall (delegate (entity m) {return M. Name = "AA ";})
C # list
Arrays do not resize dynamically.ListType in the C #
Grails project (related operations in DB)Save: Saves data from the domain object to the corresponding library table (possibly insert or update)FindBy: Dynamic method, find and return first record, method name can changeEg:findbyname ("Tom") returns
OptionalbeforeInterceptorAttribute can interrupt the operation of an action before it starts to run.
Simple tracking Interceptor:
def beforeInterceptor = { println "Tracing action ${actionUri}"}
A security verification interceptor ensures
1. Configure the email plugin to be configured in the Config.groovy file:Plugins { compile ": mail:1.0.5" }2. Configure the Config.groovy file:Grails { Mail { host = "smtp.163.com" //Outgoing mail server username =
Reference articles:
http://blog.csdn.net/aesop_wubo/article/details/8286215
http://www.aichengxu.com/view/24054
A recent encounter with the deadlock problem that arose in the domain class itself was plagued for several days,
After the resolution
Java Message Service(The Java Messaging Service, referred to as JMS) solves this problem partly by providing a way to interact with Java EE applications or traditional systems.
The universal interface collection of JMS sends or receives messages
I have created two roles, role_user and role_admin.
Two user, admin
The role corresponding to each role is user corresponding to role_user
Admin corresponds to role_admin
Then set the access path to/user/LIST/** and/user/index/** for
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.