Skip to content

Commit

Permalink
Merge pull request #141 from GServlet/develop
Browse files Browse the repository at this point in the history
merging branch develop into master
  • Loading branch information
laminba2003 committed Oct 10, 2020
2 parents 1953229 + 03604f9 commit 6ead822
Show file tree
Hide file tree
Showing 7 changed files with 78 additions and 82 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ More information can be found on the project [homepage](https://gservlet.org) wh

## Getting Started

If you are just getting started with GServlet, you may want to begin by creating your first project. This section shows you how to get up and running quickly. It is highly recommended to consume the GServlet API through a dependency management tool and the artifact can be found in Maven's central repository. it is named **gservlet-api** and you just need to name a dependency on it in your project.
If you are just getting started with GServlet, you may want to begin by creating your first project. This section shows you how to get up and running quickly. It is highly recommended to consume the GServlet API through a dependency management tool and the artifact can be found in Maven's central repository. It is named **gservlet-api** and you just need to name a dependency on it in your project.

### From Maven

Expand Down Expand Up @@ -160,7 +160,7 @@ class ServletRequestListener {
}
```

For a deep insight, please read the complete [documentation](https://gservlet.org/documentation).
For a deep insight of how to write your Groovy artifacts, please read the complete [documentation](https://gservlet.org/documentation).

## Building from source

Expand All @@ -170,7 +170,7 @@ For a deep insight, please read the complete [documentation](https://gservlet.or

### Documentation

The developer guide generated with Maven is based on [Asciidoctor](http://asciidoctor.org/). By default only the HTML output is enabled.
The developer guide generated with Maven is based on [Asciidoctor](http://asciidoctor.org/). Only the HTML output is enabled.

> mvn clean install -Pdocumentation

Expand All @@ -190,7 +190,7 @@ We version GServlet by following [Semantic Versioning](https://semver.org), whic

## Status

The current version of GServlet is 1.0.0
The current version of GServlet is 1.0.0.

## Contributing

Expand Down
138 changes: 67 additions & 71 deletions src/main/asciidoc/index.adoc

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/main/java/dsld/servlet.dsld
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ contribute(currentType(annos: annotatedBy(Servlet))) {
property name : 'response', type : javax.servlet.http.HttpServletResponse, provider : 'org.gservlet.AbstractServlet', doc : 'the HttpServletResponse object'
property name : 'session', type : javax.servlet.http.HttpSession, provider : 'org.gservlet.AbstractServlet', doc : 'the HttpSession object'
property name : 'context', type : javax.servlet.ServletContext, provider : 'org.gservlet.AbstractServlet', doc : 'the ServletContext object'
property name : 'connection', type : groovy.sql.Sql, provider : 'org.gservlet.AbstractServlet', doc : 'the Sql object'
property name : 'sql', type : groovy.sql.Sql, provider : 'org.gservlet.AbstractServlet', doc : 'the Sql object'
property name : 'out', type : java.io.PrintWriter, provider : 'org.gservlet.AbstractServlet', doc : 'the PrintWriter object'
property name : 'html', type : groovy.xml.MarkupBuilder, provider : 'org.gservlet.AbstractServlet', doc : 'the MarkupBuilder object'
}
Expand Down Expand Up @@ -59,7 +59,7 @@ contribute(currentType(annos: annotatedBy(Filter))) {
property name : 'chain', type : javax.servlet.FilterChain, provider : 'org.gservlet.AbstractFilter', doc : 'the FilterChain object'
property name : 'session', type : javax.servlet.http.HttpSession, provider : 'org.gservlet.AbstractFilter', doc : 'the HttpSession object'
property name : 'context', type : javax.servlet.ServletContext, provider : 'org.gservlet.AbstractFilter', doc : 'the ServletContext object'
property name : 'connection', type : groovy.sql.Sql, provider : 'org.gservlet.AbstractFilter', doc : 'the Sql object'
property name : 'sql', type : groovy.sql.Sql, provider : 'org.gservlet.AbstractFilter', doc : 'the Sql object'
property name : 'out', type : java.io.PrintWriter, provider : 'org.gservlet.AbstractFilter', doc : 'the PrintWriter object'
property name : 'html', type : groovy.xml.MarkupBuilder, provider : 'org.gservlet.AbstractFilter', doc : 'the MarkupBuilder object'
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/gservlet/AbstractFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ public HttpServletResponse getResponse() {
*
*/
public Sql getConnection() {
return requestContext.get().getConnection();
return requestContext.get().getSql();
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/gservlet/AbstractServlet.java
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,8 @@ public HttpServletResponse getResponse() {
* @return the Sql object
*
*/
public Sql getConnection() {
return requestContext.get().getConnection();
public Sql getSql() {
return requestContext.get().getSql();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/gservlet/RequestContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public MarkupBuilder getHtml() throws IOException {
* @return the Sql object
*
*/
public Sql getConnection() {
public Sql getSql() {
return (Sql) request.getAttribute(Constants.CONNECTION);
}

Expand Down
2 changes: 1 addition & 1 deletion src/test/java/org/gservlet/HttpServletTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public Object answer(InvocationOnMock invocation) throws Throwable {
assertEquals(SessionWrapper.class, servlet.getSession().getClass());
assertEquals(ContextWrapper.class, servlet.getContext().getClass());
assertNull(servlet.getConfig());
assertNotNull(servlet.getConnection());
assertNotNull(servlet.getSql());
}

@SuppressWarnings("rawtypes")
Expand Down

0 comments on commit 6ead822

Please sign in to comment.