本文整理汇总了Java中org.apache.struts.action.ActionMapping.findForward方法的典型用法代码示例。如果您正苦于以下问题:Java ActionMapping.findForward方法的具体用法?Java ActionMapping.findForward怎么用?Java ActionMapping.findForward使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.struts.action.ActionMapping
的用法示例。
在下文中一共展示了ActionMapping.findForward方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: openNotebook
import org.apache.struts.action.ActionMapping; //导入方法依赖的package包/类
/**
* Opens the notebook page for reflections
*
* @param mapping
* @param form
* @param request
* @param response
* @return
*/
public ActionForward openNotebook(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) {
LearningForm lrnForm = (LearningForm) form;
// set the finished flag
WikiUser wikiUser = this.getCurrentUser(lrnForm.getToolSessionID());
WikiDTO wikiDTO = new WikiDTO(wikiUser.getWikiSession().getWiki());
request.setAttribute("wikiDTO", wikiDTO);
NotebookEntry notebookEntry = wikiService.getEntry(wikiUser.getWikiSession().getSessionId(),
CoreNotebookConstants.NOTEBOOK_TOOL, WikiConstants.TOOL_SIGNATURE, wikiUser.getUserId().intValue());
if (notebookEntry != null) {
lrnForm.setEntryText(notebookEntry.getEntry());
}
LearningWebUtil.putActivityPositionInRequestByToolSessionId(lrnForm.getToolSessionID(), request,
getServlet().getServletContext());
return mapping.findForward("notebook");
}
示例2: statistic
import org.apache.struts.action.ActionMapping; //导入方法依赖的package包/类
private ActionForward statistic(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) {
initializeScratchieService();
String sessionMapID = request.getParameter(ScratchieConstants.ATTR_SESSION_MAP_ID);
SessionMap<String, Object> sessionMap = (SessionMap<String, Object>) request.getSession()
.getAttribute(sessionMapID);
request.setAttribute(ScratchieConstants.ATTR_SESSION_MAP_ID, sessionMap.getSessionID());
Scratchie scratchie = (Scratchie) sessionMap.get(ScratchieConstants.ATTR_SCRATCHIE);
if ( scratchie != null ) {
LeaderResultsDTO leaderDto = service.getLeaderResultsDTOForLeaders(scratchie.getContentId());
sessionMap.put("leaderDto", leaderDto);
}
return mapping.findForward(ScratchieConstants.SUCCESS);
}
示例3: saveRoomGroup
import org.apache.struts.action.ActionMapping; //导入方法依赖的package包/类
/**
*
* @param mapping
* @param form
* @param request
* @param response
* @return
* @throws Exception
*/
public ActionForward saveRoomGroup(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws Exception {
RoomGroupEditForm roomGroupEditForm = (RoomGroupEditForm) form;
ActionMessages errors = new ActionMessages();
//Validate input prefs
errors = roomGroupEditForm.validate(mapping, request);
if(errors.size()==0) {
update(mapping, roomGroupEditForm, request, response);
} else {
saveErrors(request, errors);
editRoomGroup(mapping, form, request, response);
return mapping.findForward("showEdit");
}
if (roomGroupEditForm.getId()!=null)
request.setAttribute("hash", "A"+roomGroupEditForm.getId());
return mapping.findForward("showRoomGroupList");
}
示例4: execute
import org.apache.struts.action.ActionMapping; //导入方法依赖的package包/类
/**
* Processes the specified HTTP request and creates the corresponding HTTP response by forwarding to a JSP
* that will create it. Returns an {@link org.apache.struts.action.ActionForward} instance that maps to the
* Struts forwarding name "simple.query," which must be configured in struts-config.xml to forward to the
* JSP page that will handle the request.
*
* @param mapping The ActionMapping used to select this instance
* @param request The HTTP request we are processing
* @param response The HTTP response we are creating
* @param form The ActionForm for the given page
* @return The ActionForward instance describing where and how control should be
* forwarded
* @exception IOException if an input/output error occurs
* @exception ServletException if a servlet exception occurs
*/
public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException {
/*
* Design note:
* Only one instance of this class gets created for the app and shared by
* all threads. To be thread-safe, use only local variables, not instance
* variables (the JVM will handle these properly using the stack). Pass
* all variables via method signatures rather than instance vars.
*/
OdlSearchForm osf = (OdlSearchForm) form;
// Set up params for paging:
if (request.getParameter("s") != null) {
try {
} catch (Throwable e) {}
}
return mapping.findForward("remote.query");
}
示例5: saveContent
import org.apache.struts.action.ActionMapping; //导入方法依赖的package包/类
public ActionForward saveContent(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) {
AdminForm adminForm = (AdminForm) form;
if (adminForm.getLanguagesCSV() != null && !adminForm.getLanguagesCSV().equals("")) {
// set up mdlForumService
if (pixlrService == null) {
pixlrService = PixlrServiceProxy.getPixlrService(this.getServlet().getServletContext());
}
PixlrConfigItem pixlrKey = pixlrService.getConfigItem(PixlrConfigItem.KEY_LANGUAGE_CSV);
pixlrKey.setConfigValue(adminForm.getLanguagesCSV());
pixlrService.saveOrUpdatePixlrConfigItem(pixlrKey);
request.setAttribute("savedSuccess", true);
return mapping.findForward("config");
} else {
request.setAttribute("error", true);
return mapping.findForward("config");
}
}
示例6: newCandidateBox
import org.apache.struts.action.ActionMapping; //导入方法依赖的package包/类
public ActionForward newCandidateBox(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws IOException, ServletException {
String sessionMapId = request.getParameter(McAppConstants.ATTR_SESSION_MAP_ID);
SessionMap<String, Object> sessionMap = (SessionMap<String, Object>) request.getSession()
.getAttribute(sessionMapId);
request.setAttribute(McAppConstants.ATTR_SESSION_MAP_ID, sessionMapId);
String candidateIndex = request.getParameter("candidateIndex");
request.setAttribute("candidateIndex", candidateIndex);
List<McOptionDTO> optionDtos = McAction.repopulateOptionDTOs(request, true);
//newAddedCandidateBox
McQuestionDTO questionDto = (McQuestionDTO) sessionMap.get(McAppConstants.QUESTION_DTO);
questionDto.setOptionDtos(optionDtos);
sessionMap.put(McAppConstants.QUESTION_DTO, questionDto);
return (mapping.findForward("candidateAnswersList"));
}
示例7: execute
import org.apache.struts.action.ActionMapping; //导入方法依赖的package包/类
public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws HibernateException {
return mapping.findForward("showInstructionalOfferingList");
}
示例8: viewTopic
import org.apache.struts.action.ActionMapping; //导入方法依赖的package包/类
/**
* View topic subject, content and attachement.
*
* @param mapping
* @param form
* @param request
* @param response
* @return
*/
private ActionForward viewTopic(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) {
Long msgUid = new Long(WebUtil.readLongParam(request, ForumConstants.ATTR_TOPIC_ID));
forumService = getForumService();
Message topic = forumService.getMessage(msgUid);
request.setAttribute(ForumConstants.AUTHORING_TOPIC, MessageDTO.getMessageDTO(topic));
return mapping.findForward("success");
}
示例9: unspecified
import org.apache.struts.action.ActionMapping; //导入方法依赖的package包/类
@Override
public ActionForward unspecified(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) {
setupService();
Long toolContentID = new Long(WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID));
String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
Gmap gmap = gmapService.getGmapByContentId(toolContentID);
if (gmap == null) {
// TODO error page.
}
GmapDTO gmapDT0 = new GmapDTO(gmap);
// Adding the markers lists to a map with tool sessions as the key
if (gmapDT0.getSessionDTOs() != null) {
for (GmapSessionDTO sessionDTO : gmapDT0.getSessionDTOs()) {
Long toolSessionID = sessionDTO.getSessionID();
sessionDTO.setMarkerDTOs(gmapService.getGmapMarkersBySessionId(toolSessionID));
}
}
// get the gmap API key from the config table and add it to the session
GmapConfigItem gmapKey = gmapService.getConfigItem(GmapConfigItem.KEY_GMAP_KEY);
if (gmapKey != null && gmapKey.getConfigValue() != null) {
request.setAttribute(GmapConstants.ATTR_GMAP_KEY, gmapKey.getConfigValue());
}
boolean isGroupedActivity = gmapService.isGroupedActivity(toolContentID);
request.setAttribute("isGroupedActivity", isGroupedActivity);
request.setAttribute("gmapDTO", gmapDT0);
request.setAttribute("contentFolderID", contentFolderID);
return mapping.findForward("success");
}
示例10: viewAll
import org.apache.struts.action.ActionMapping; //导入方法依赖的package包/类
/**
* View all notebook entries
*/
public ActionForward viewAll(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request,
HttpServletResponse response) throws IOException, ServletException {
// initialize service object
ICoreNotebookService notebookService = getNotebookService();
DynaActionForm notebookForm = (DynaActionForm) actionForm;
// getting requested object according to coming parameters
Integer learnerID = LearningWebUtil.getUserId();
// lessonID
Long lessonID = (Long) notebookForm.get("currentLessonID");
if (lessonID == null || lessonID == 0) {
lessonID = (Long) notebookForm.get(AttributeNames.PARAM_LESSON_ID);
}
// get all notebook entries for the learner
TreeMap<Long, List<NotebookEntry>> entries = notebookService.getEntryByLesson(learnerID,
CoreNotebookConstants.SCRATCH_PAD);
request.getSession().setAttribute("entries", entries.values());
request.setAttribute("lessonID", lessonID);
return mapping.findForward(NotebookAction.VIEW_ALL);
}
示例11: saveOrUpdateCondition
import org.apache.struts.action.ActionMapping; //导入方法依赖的package包/类
/**
* This method will get necessary information from taskList item form and save or update into
* <code>HttpSession</code> ChatItemList. Notice, this save is not persist them into database, just save
* <code>HttpSession</code> temporarily. Only they will be persist when the entire authoring page is being
* persisted.
*
* @param mapping
* @param form
* @param request
* @param response
* @return
* @throws ServletException
*/
private ActionForward saveOrUpdateCondition(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) {
ChatConditionForm conditionForm = (ChatConditionForm) form;
ActionErrors errors = validateChatCondition(conditionForm, request);
if (!errors.isEmpty()) {
this.addErrors(request, errors);
return mapping.findForward("addcondition");
}
try {
extractFormToChatCondition(request, conditionForm);
} catch (Exception e) {
// any upload exception will display as normal error message rather then throw exception directly
errors.add(ActionMessages.GLOBAL_MESSAGE,
new ActionMessage(ChatConstants.ERROR_MSG_CONDITION, e.getMessage()));
if (!errors.isEmpty()) {
this.addErrors(request, errors);
return mapping.findForward("addcondition");
}
}
// set session map ID so that itemlist.jsp can get sessionMAP
request.setAttribute(ChatConstants.ATTR_SESSION_MAP_ID, conditionForm.getSessionMapID());
// return null to close this window
return mapping.findForward(ChatConstants.SUCCESS);
}
示例12: newReflection
import org.apache.struts.action.ActionMapping; //导入方法依赖的package包/类
/**
* Display empty reflection form.
*
* @param mapping
* @param form
* @param request
* @param response
* @return
*/
private ActionForward newReflection(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) {
//get session value
String sessionMapID = WebUtil.readStrParam(request, SpreadsheetConstants.ATTR_SESSION_MAP_ID);
ReflectionForm refForm = (ReflectionForm) form;
HttpSession ss = SessionManager.getSession();
UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER);
refForm.setUserID(user.getUserID());
refForm.setSessionMapID(sessionMapID);
// get the existing reflection entry
ISpreadsheetService submitFilesService = getSpreadsheetService();
SessionMap<String, Object> sessionMap = (SessionMap<String, Object>) request.getSession().getAttribute(sessionMapID);
Long toolSessionID = (Long) sessionMap.get(AttributeNames.PARAM_TOOL_SESSION_ID);
NotebookEntry entry = submitFilesService.getEntry(toolSessionID, CoreNotebookConstants.NOTEBOOK_TOOL,
SpreadsheetConstants.TOOL_SIGNATURE, user.getUserID());
if (entry != null) {
refForm.setEntryText(entry.getEntry());
}
return mapping.findForward(SpreadsheetConstants.SUCCESS);
}
示例13: switchItem
import org.apache.struts.action.ActionMapping; //导入方法依赖的package包/类
private ActionForward switchItem(ActionMapping mapping, HttpServletRequest request, boolean up) {
// get back sessionMAP
String sessionMapID = WebUtil.readStrParam(request, ImageGalleryConstants.ATTR_SESSION_MAP_ID);
SessionMap<String, Object> sessionMap = (SessionMap<String, Object>) request.getSession().getAttribute(sessionMapID);
int imageIdx = NumberUtils.stringToInt(request.getParameter(ImageGalleryConstants.PARAM_IMAGE_INDEX), -1);
if (imageIdx != -1) {
SortedSet<ImageGalleryItem> taskListList = getImageList(sessionMap);
List<ImageGalleryItem> rList = new ArrayList<ImageGalleryItem>(taskListList);
// get current and the target item, and switch their sequnece
ImageGalleryItem image = rList.get(imageIdx);
ImageGalleryItem repImage;
if (up) {
repImage = rList.get(--imageIdx);
} else {
repImage = rList.get(++imageIdx);
}
int upSeqId = repImage.getSequenceId();
repImage.setSequenceId(image.getSequenceId());
image.setSequenceId(upSeqId);
// put back list, it will be sorted again
taskListList.clear();
taskListList.addAll(rList);
}
request.setAttribute(ImageGalleryConstants.ATTR_SESSION_MAP_ID, sessionMapID);
return mapping.findForward(ImageGalleryConstants.SUCCESS);
}
示例14: doListSets
import org.apache.struts.action.ActionMapping; //导入方法依赖的package包/类
/**
* Handles the OAI ListSets request. From the spec, this request has the following properties: <p>
*
* Arguments<br>
* resumptionToken - an exclusive argument with a value that is the flow control token returned by a
* previous ListSets request that issued an incomplete list<p>
*
* Error and Exception Conditions<br>
* badArgument - The request includes illegal arguments or is missing required arguments.<br>
* badResumptionToken - The value of the resumptionToken argument is invalid or expired. <br>
* noSetHierarchy - The repository does not support sets.<br>
*
*
* @param request The HTTP request.
* @param mapping The Struts ActionMapping used for forwarding.
* @param num_args The number of arguments other than the OAI verb or rt.
* @param rm The model used to fetch OAI data.
* @param rf The bean used to handle the response.
* @return The page to forward to that will render the response, or null if handled here.
*/
protected ActionForward doListSets(
HttpServletRequest request,
ActionMapping mapping,
int num_args,
RepositoryManager rm,
RepositoryForm rf) {
//prtln("doListSets()");
if (request.getParameter(OAIArgs.RESUMPTION_TOKEN) == null &&
num_args >= 1)
rf.addOaiError(OAICodes.BAD_ARGUMENT,
"The " + OAIArgs.LIST_SETS +
" request may only include the argument '" +
OAIArgs.RESUMPTION_TOKEN + "'");
if (!rm.getHasOaiSetsConfigured())
rf.addOaiError(OAICodes.NO_SET_HIERARCHY,
"This repository does not currently have any sets defined");
// All info is extracted directly from the rm so no set up here...
if (rf.hasErrors()) {
logRequest(request, OAIArgs.LIST_SETS, rf.getErrors());
return (mapping.findForward("oaipmh.error"));
}
else {
logRequest(request, OAIArgs.LIST_SETS);
return (mapping.findForward("oaipmh." + OAIArgs.LIST_SETS));
}
}
示例15: unspecified
import org.apache.struts.action.ActionMapping; //导入方法依赖的package包/类
@Override
public ActionForward unspecified(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws Exception {
try {
Long lessonId = WebUtil.readLongParam(request, AttributeNames.PARAM_LESSON_ID);
if (GradebookMonitoringAction.log.isDebugEnabled()) {
GradebookMonitoringAction.log.debug("Getting gradebook for lesson " + lessonId);
}
UserDTO user = getUser();
if (user == null) {
GradebookMonitoringAction.log.error("User missing from session. ");
return mapping.findForward("error");
}
if (!getSecurityService().isLessonMonitor(lessonId, user.getUserID(), "get lesson gradebook", false)) {
response.sendError(HttpServletResponse.SC_FORBIDDEN, "User is not a monitor in the lesson");
return null;
}
Lesson lesson = getLessonService().getLesson(lessonId);
boolean marksReleased = (lesson.getMarksReleased() != null) && lesson.getMarksReleased();
LessonDetailsDTO lessonDetatilsDTO = lesson.getLessonDetails();
request.setAttribute("lessonDetails", lessonDetatilsDTO);
request.setAttribute("marksReleased", marksReleased);
List<String[]> weights = getGradebookService().getWeights(lesson.getLearningDesign());
if ( weights.size() > 0 ) {
request.setAttribute("weights", weights);
}
request.setAttribute("isInTabs", WebUtil.readBooleanParam(request, "isInTabs", false));
return mapping.findForward("monitorgradebook");
} catch (Exception e) {
GradebookMonitoringAction.log.error("Failed to load lesson gradebook", e);
return mapping.findForward("error");
}
}