Remove dependency of the core on javax.servlet #85

Merged
merged 5 commits into from Apr 8, 2013

Conversation

Projects
None yet
3 participants
@tbroyer
Contributor

tbroyer commented Apr 7, 2013

This is a breaking change but rather with limited impact:

  • Context.getHttpServletRequest / Response methods were @Deprecated already
  • FlashCookie / SessionCookie's save method now take Result as a second parameter, but users are not supposed to call those methods (or are they?)
  • several classes relocated (ninja.asyncninja.servlet.async, ninja.utils.CookieHelpercookie.servlet.CookieHelper, ninja.utils.ResponseStreamsServletninja.servlet.ResponseStreamsServlet)
  • biggest breaking change: introduce a new ninja-servlet module where all servlet-related code lives (so that ninja-core doesn't depend on guice-servlet or javax.servlet)

This paves the way for supporting other containers, such as Netty or Grizzly.

TODO: move the test lib to an in-process model, possibly splitting the jetty-based implementation into its own module (or removing it entirely); similarly to how Jersey 2.0 provides several backends for tests.

@buildhive

This comment has been minimized.

Show comment
Hide comment
@buildhive

buildhive Apr 7, 2013

reyez » ninja #286 SUCCESS
This pull request looks good
(what's this?)

reyez » ninja #286 SUCCESS
This pull request looks good
(what's this?)

@buildhive

This comment has been minimized.

Show comment
Hide comment
@buildhive

buildhive Apr 7, 2013

reyez » ninja #287 SUCCESS
This pull request looks good
(what's this?)

reyez » ninja #287 SUCCESS
This pull request looks good
(what's this?)

@buildhive

This comment has been minimized.

Show comment
Hide comment
@buildhive

buildhive Apr 7, 2013

reyez » ninja #288 FAILURE
Looks like there's a problem with this pull request
(what's this?)

reyez » ninja #288 FAILURE
Looks like there's a problem with this pull request
(what's this?)

@buildhive

This comment has been minimized.

Show comment
Hide comment
@buildhive

buildhive Apr 7, 2013

reyez » ninja #289 FAILURE
Looks like there's a problem with this pull request
(what's this?)

reyez » ninja #289 FAILURE
Looks like there's a problem with this pull request
(what's this?)

@buildhive

This comment has been minimized.

Show comment
Hide comment
@buildhive

buildhive Apr 7, 2013

reyez » ninja #290 SUCCESS
This pull request looks good
(what's this?)

reyez » ninja #290 SUCCESS
This pull request looks good
(what's this?)

@buildhive

This comment has been minimized.

Show comment
Hide comment
@buildhive

buildhive Apr 7, 2013

reyez » ninja #291 SUCCESS
This pull request looks good
(what's this?)

reyez » ninja #291 SUCCESS
This pull request looks good
(what's this?)

@raphaelbauer

This comment has been minimized.

Show comment
Hide comment
@raphaelbauer

raphaelbauer Apr 8, 2013

Contributor

Hi Thomas,

looks really good.

Just one thing: Why did you add Result to the Session and Flash Scopes? When you finalize the headers the request stuff gets copied over automatically... https://github.com/reyez/ninja/blob/develop/ninja-core/src/main/java/ninja/servlet/ContextImpl.java and finalizeHeaders . Maybe I am missing something here...

Thanks,

raphael

Contributor

raphaelbauer commented Apr 8, 2013

Hi Thomas,

looks really good.

Just one thing: Why did you add Result to the Session and Flash Scopes? When you finalize the headers the request stuff gets copied over automatically... https://github.com/reyez/ninja/blob/develop/ninja-core/src/main/java/ninja/servlet/ContextImpl.java and finalizeHeaders . Maybe I am missing something here...

Thanks,

raphael

@tbroyer

This comment has been minimized.

Show comment
Hide comment
@tbroyer

tbroyer Apr 8, 2013

Contributor

Have a look at the changes in FlashCookieImpl and SessionCookieImpl: they used getHttpRequestResponse to addCookie. If you remove that method, then they have no way to add a cookie to the response other than Result#addCookie, which is the proper of doing it: read from Context, write to Result.

Contributor

tbroyer commented Apr 8, 2013

Have a look at the changes in FlashCookieImpl and SessionCookieImpl: they used getHttpRequestResponse to addCookie. If you remove that method, then they have no way to add a cookie to the response other than Result#addCookie, which is the proper of doing it: read from Context, write to Result.

@raphaelbauer

This comment has been minimized.

Show comment
Hide comment
@raphaelbauer

raphaelbauer Apr 8, 2013

Contributor

Ah yes. I missed that one. Very cool Thomas...

Contributor

raphaelbauer commented Apr 8, 2013

Ah yes. I missed that one. Very cool Thomas...

raphaelbauer added a commit that referenced this pull request Apr 8, 2013

Merge pull request #85 from tbroyer/remove-servlet-dependency
Remove dependency of the core on javax.servlet

@raphaelbauer raphaelbauer merged commit d730a1f into ninjaframework:develop Apr 8, 2013

@tbroyer tbroyer deleted the tbroyer:remove-servlet-dependency branch Apr 9, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment