-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change to switch perm space name by JRE version
- Loading branch information
Showing
5 changed files
with
52 additions
and
27 deletions.
There are no files selected for viewing
55 changes: 37 additions & 18 deletions
55
src/main/java/org/t246osslab/easybuggy4sb/controller/IndexController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,38 @@ | ||
package org.t246osslab.easybuggy4sb.controller; | ||
|
||
import javax.servlet.http.HttpSession; | ||
|
||
import org.springframework.stereotype.Controller; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.servlet.ModelAndView; | ||
|
||
@Controller | ||
public class IndexController { | ||
|
||
@RequestMapping(value = "/") | ||
public ModelAndView init(HttpSession ses, ModelAndView mav) { | ||
ses.removeAttribute("dlpinit"); | ||
mav.setViewName("index"); | ||
mav.addObject("title", "EasyBuggy"); | ||
return mav; | ||
} | ||
package org.t246osslab.easybuggy4sb.controller; | ||
|
||
import java.util.Locale; | ||
|
||
import javax.servlet.http.HttpSession; | ||
|
||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.context.MessageSource; | ||
import org.springframework.stereotype.Controller; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.servlet.ModelAndView; | ||
|
||
@Controller | ||
public class IndexController { | ||
|
||
@Autowired | ||
MessageSource msg; | ||
|
||
@RequestMapping(value = "/") | ||
public ModelAndView init(HttpSession ses, ModelAndView mav, Locale locale) { | ||
ses.removeAttribute("dlpinit"); | ||
mav.setViewName("index"); | ||
mav.addObject("title", "EasyBuggy"); | ||
String permName = null; | ||
String lblPerm = null; | ||
if (System.getProperty("java.version").startsWith("1.7")) { | ||
permName = "PermGen space"; | ||
lblPerm = msg.getMessage("label.permgen.space", null, locale); | ||
} else { | ||
permName = "Metaspace"; | ||
lblPerm = msg.getMessage("label.metaspace", null, locale); | ||
} | ||
mav.addObject("permname", permName); | ||
mav.addObject("memoryleak2func", msg.getMessage("function.name.memory.leak2", new Object[] { lblPerm }, locale)); | ||
mav.addObject("memoryleak2desc", msg.getMessage("function.description.memory.leak2", new Object[] { lblPerm }, locale)); | ||
return mav; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters