本文整理汇总了Java中org.apache.struts.action.DynaActionForm类的典型用法代码示例。如果您正苦于以下问题:Java DynaActionForm类的具体用法?Java DynaActionForm怎么用?Java DynaActionForm使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DynaActionForm类属于org.apache.struts.action包,在下文中一共展示了DynaActionForm类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: openGateForSingleUser
import org.apache.struts.action.DynaActionForm; //导入依赖的package包/类
/**
* Allows a single learner to pass the gate.
*
* @param mapping
* An ActionMapping class that will be used by the Action class to tell the ActionServlet where to send
* the end-user.
* @param form
* he ActionForm class that will contain any data submitted by the end-user via a form.
* @param request
* A standard Servlet HttpServletRequest class.
* @param response
* A standard Servlet HttpServletRequest class.
* @return An ActionForward class that will be returned to the ActionServlet indicating where the user is to go
* next.
* @throws IOException
* @throws ServletException
*/
public ActionForward openGateForSingleUser(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws IOException, ServletException {
monitoringService = MonitoringServiceProxy.getMonitoringService(getServlet().getServletContext());
DynaActionForm gateForm = (DynaActionForm) form;
Long gateIdLong = (Long) gateForm.get(GateAction.ACTIVITY_FORM_FIELD);
String userId = (String) gateForm.get(GateAction.USER_ID);
String[] userIdsString = userId.split(",");
List<Integer> userIds = new LinkedList<Integer>();
for (String userIdString : userIdsString) {
if (StringUtils.isNotBlank(userIdString)) {
userIds.add(Integer.valueOf(userIdString));
}
}
GateActivity gate = monitoringService.openGateForSingleUser(gateIdLong, userIds.toArray(new Integer[] {}));
return findViewByGateType(mapping, gateForm, gate);
}
示例2: viewScheduleGate
import org.apache.struts.action.DynaActionForm; //导入依赖的package包/类
/**
* Set up the form attributes specific to the schedule gate and navigate to the schedule gate view.
*
* @param mapping
* An ActionMapping class that will be used by the Action class to tell the ActionServlet where to send
* the end-user.
* @param gateForm
* The ActionForm class that will contain any data submitted by the end-user via a form.
* @param permissionGate
* the gate acitivty object
* @return An ActionForward class that will be returned to the ActionServlet indicating where the user is to go
* next.
*/
private ActionForward viewScheduleGate(ActionMapping mapping, DynaActionForm gateForm,
ScheduleGateActivity scheduleGate) {
if (Boolean.TRUE.equals(scheduleGate.getGateActivityCompletionBased())) {
gateForm.set("activityCompletionBased", true);
} else {
gateForm.set("activityCompletionBased", false);
learnerService = MonitoringServiceProxy.getLearnerService(getServlet().getServletContext());
Lesson lesson = learnerService.getLessonByActivity(scheduleGate);
Calendar startingTime = new GregorianCalendar(TimeZone.getDefault());
startingTime.setTime(lesson.getStartDateTime());
startingTime.add(Calendar.MINUTE, scheduleGate.getGateStartTimeOffset().intValue());
gateForm.set("startingTime", startingTime.getTime());
}
return mapping.findForward(GateAction.VIEW_SCHEDULE_GATE);
}
示例3: setType
import org.apache.struts.action.DynaActionForm; //导入依赖的package包/类
public void setType(String type) {
if (configured) {
throw new IllegalStateException("Configuration is frozen");
}
this.type = type;
Class dynaBeanClass = DynaActionForm.class;
Class formBeanClass = formBeanClass();
if (formBeanClass != null) {
if (dynaBeanClass.isAssignableFrom(formBeanClass)) {
this.dynamic = true;
} else {
this.dynamic = false;
}
} else {
this.dynamic = false;
}
}
示例4: processNewEntry
import org.apache.struts.action.DynaActionForm; //导入依赖的package包/类
/**
*
*/
public ActionForward processNewEntry(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request,
HttpServletResponse response) throws IOException, ServletException {
// initialize service object
ICoreNotebookService notebookService = getNotebookService();
DynaActionForm notebookForm = (DynaActionForm) actionForm;
Long id = (Long) notebookForm.get(AttributeNames.PARAM_LESSON_ID);
String title = (String) notebookForm.get("title");
String entry = (String) notebookForm.get("entry");
String signature = (String) notebookForm.get("signature");
Integer userID = LearningWebUtil.getUserId();
notebookService.createNotebookEntry(id, CoreNotebookConstants.SCRATCH_PAD, signature, userID, title, entry);
boolean skipViewAll = WebUtil.readBooleanParam(request, "skipViewAll", false);
return skipViewAll ? null : viewAll(mapping, actionForm, request, response);
}
示例5: edit
import org.apache.struts.action.DynaActionForm; //导入依赖的package包/类
/**
* Edits specified LTI tool consumer
*/
public ActionForward edit(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws Exception {
initServices();
DynaActionForm ltiConsumerForm = (DynaActionForm) form;
Integer sid = WebUtil.readIntParam(request, "sid", true);
// editing a tool consumer
if (sid != null) {
ExtServer ltiConsumer = integrationService.getExtServer(sid);
BeanUtils.copyProperties(ltiConsumerForm, ltiConsumer);
String lessonFinishUrl = ltiConsumer.getLessonFinishUrl() == null ? "-" : ltiConsumer.getLessonFinishUrl();
request.setAttribute("lessonFinishUrl", lessonFinishUrl);
// create a tool consumer
} else {
//do nothing
}
return mapping.findForward("ltiConsumer");
}
示例6: save
import org.apache.struts.action.DynaActionForm; //导入依赖的package包/类
/**
* Makes selected timezones default ones.
*
* @param mapping
* @param form
* @param request
* @param response
* @return
* @throws Exception
*/
public ActionForward save(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws Exception {
if (isCancelled(request)) {
return mapping.findForward(FORWARD_BACK);
}
DynaActionForm timezoneForm = (DynaActionForm) form;
String[] selectedTimezoneIds = (String[]) timezoneForm.get("selected");
List<Timezone> selectedTimezones = new ArrayList<Timezone>();
for (String selectedTimezoneId : selectedTimezoneIds) {
selectedTimezones.add(new Timezone(selectedTimezoneId));
}
timezoneService.updateTimezones(selectedTimezones);
return mapping.findForward(FORWARD_BACK);
}
示例7: create
import org.apache.struts.action.DynaActionForm; //导入依赖的package包/类
public ActionForward create(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws Exception {
OrganisationAction.service = AdminServiceProxy.getService(getServlet().getServletContext());
initLocalesAndStatus();
DynaActionForm orgForm = (DynaActionForm) form;
if (!(request.isUserInRole(Role.SYSADMIN) || OrganisationAction.service.isUserGlobalGroupAdmin())) {
// only sysadmins and global group admins can create groups
if (((orgForm.get("typeId") != null) && orgForm.get("typeId").equals(OrganisationType.COURSE_TYPE))
|| (orgForm.get("typeId") == null)) {
return error(mapping, request);
}
}
// creating new organisation
orgForm.set("orgId", null);
Integer parentId = WebUtil.readIntParam(request, "parentId", true);
if (parentId != null) {
Organisation parentOrg = (Organisation) OrganisationAction.service.findById(Organisation.class, parentId);
orgForm.set("parentName", parentOrg.getName());
}
request.getSession().setAttribute("locales", OrganisationAction.locales);
request.getSession().setAttribute("status", OrganisationAction.status);
return mapping.findForward("organisation");
}
示例8: executeTask
import org.apache.struts.action.DynaActionForm; //导入依赖的package包/类
public ActionForward executeTask(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws Exception
{
DynaActionForm dynaActionForm = ( DynaActionForm ) form;
String xmlForm = ( String ) dynaActionForm.get( "datosAnteriores" );
mapping.getModuleConfig().findFormBeanConfig( "fakeRetornarATramitacionForm" );
Analizador analizador = new Analizador();
HashMapIterable datos = analizador.analizar(new ByteArrayInputStream ( xmlForm.getBytes( ConstantesXML.ENCODING )),ConstantesXML.ENCODING);
for (Iterator it=datos.iterator();it.hasNext();)
{
Nodo nodo = (Nodo)it.next();
String campo = nodo.getXpath().substring(("/instancia/").length());
dynaActionForm.set( campo, nodo.getValor());
}
request.setAttribute( Constants.DESCRIPCION_TRAMITE_PARAMS_KEY, request.getParameter( Constants.DESCRIPCION_TRAMITE_PARAMS_KEY) );
return mapping.findForward( "success" );
}
示例9: run_custom_filter
import org.apache.struts.action.DynaActionForm; //导入依赖的package包/类
public ActionForward run_custom_filter(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) {
log.debug("run_custom_filter");
DynaActionForm ticklerForm = (DynaActionForm) form;
CustomFilter filter = (CustomFilter) ticklerForm.get("filter");
String name = filter.getName();
// CustomFilter newFilter = ticklerMgr.getCustomFilter(name);
CustomFilter newFilter = ticklerManager.getCustomFilter(name, this.getProviderNo(request));
/*
* String filterId = Long.toString(filter.getId()); CustomFilter newFilter = ticklerMgr.getCustomFilterById(Integer.valueOf(filterId));
*/
if (newFilter == null) {
newFilter = new CustomFilter();
}
ticklerForm.set("filter", newFilter);
return filter(mapping, form, request, response);
}
示例10: save
import org.apache.struts.action.DynaActionForm; //导入依赖的package包/类
public ActionForward save(ActionMapping mapping,ActionForm form, HttpServletRequest request, HttpServletResponse response) {
DynaActionForm userForm = (DynaActionForm)form;
FacilityMessage msg = (FacilityMessage)userForm.get("facility_message");
msg.setCreationDate(new Date());
Integer facilityId = msg.getFacilityId().intValue();
String facilityName = "";
if(facilityId!=null && facilityId.intValue()!=0)
facilityName = facilityDao.find(facilityId).getName();
msg.setFacilityName(facilityName);
mgr.saveFacilityMessage(msg);
ActionMessages messages = new ActionMessages();
messages.add(ActionMessages.GLOBAL_MESSAGE,new ActionMessage("system_message.saved"));
saveMessages(request,messages);
return list(mapping,form,request,response);
}
示例11: execute
import org.apache.struts.action.DynaActionForm; //导入依赖的package包/类
/**
* This is the action called from the Struts framework.
* @param mapping The ActionMapping used to select this instance.
* @param form The optional ActionForm bean for this request.
* @param request The HTTP Request we are processing.
* @param response The HTTP Response we are processing.
* @throws java.lang.Exception
* @return
*/
@Override
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
DynaActionForm inputForm = (DynaActionForm) form;
RestaurantManager manager = new RestaurantManager();
String login = inputForm.getString("login");
String password = inputForm.getString("password");
UserInfo user = manager.findUser(login, password);
if (user != null) {
HttpSession session = request.getSession();
session.setAttribute("user", user);
return mapping.findForward(SUCCESS);
}
ActionMessages errors = new ActionErrors();
ActionMessage msg = new ActionMessage("errors.loginfailed", "login/password");
errors.add(ActionMessages.GLOBAL_MESSAGE, msg);
saveErrors(request, errors);
return mapping.findForward(FAILURE);
}
示例12: execute
import org.apache.struts.action.DynaActionForm; //导入依赖的package包/类
/**
* This is the action called from the Struts framework.
* @param mapping The ActionMapping used to select this instance.
* @param form The optional ActionForm bean for this request.
* @param request The HTTP Request we are processing.
* @param response The HTTP Response we are processing.
* @throws java.lang.Exception
* @return
*/
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
DynaActionForm inputFormPlace = (DynaActionForm) form;
RestaurantManager manager = new RestaurantManager();
List products = new ArrayList<ProductInfoExt>();
products = manager.findProductsByCategory((String) inputFormPlace.get("categoryId"));
List rates = new ArrayList<String>();
rates = manager.findAllTaxRatesByCategory(products);
request.getSession().setAttribute("products", products);
request.getSession().setAttribute("rates", rates);
if (inputFormPlace.get("mode").equals("1")) {
request.setAttribute("subcategories", manager.findAllSubcategories(inputFormPlace.getString("categoryId")));
return mapping.findForward(NEXTLEVEL);
}
request.setAttribute("subcategories", manager.findAllSubcategories(inputFormPlace.getString("categoryId")));
return mapping.findForward(SUCCESS);
}
示例13: assign_team
import org.apache.struts.action.DynaActionForm; //导入依赖的package包/类
public ActionForward assign_team(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) {
DynaActionForm providerForm = (DynaActionForm)form;
Provider provider = (Provider)providerForm.get("provider");
ProgramProvider pp = (ProgramProvider)providerForm.get("program_provider");
ProgramProvider existingPP = null;
existingPP = programManager.getProgramProvider(provider.getProviderNo(),String.valueOf(pp.getProgramId()));
String teamId = request.getParameter("teamId");
ProgramTeam team = programManager.getProgramTeam(teamId);
if(existingPP != null && team != null) {
existingPP.getTeams().add(team);
programManager.saveProgramProvider(existingPP);
}
setEditAttributes(request,providerManager.getProvider(provider.getProviderNo()));
providerForm.set("program_provider",new ProgramProvider());
return mapping.findForward("edit");
}
示例14: remove_team
import org.apache.struts.action.DynaActionForm; //导入依赖的package包/类
public ActionForward remove_team(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) {
DynaActionForm providerForm = (DynaActionForm)form;
Provider provider = (Provider)providerForm.get("provider");
ProgramProvider pp = (ProgramProvider)providerForm.get("program_provider");
ProgramProvider existingPP = null;
existingPP = programManager.getProgramProvider(provider.getProviderNo(),String.valueOf(pp.getProgramId()));
String teamId = request.getParameter("teamId");
if (existingPP != null && teamId != null && teamId.length() > 0) {
long team_id = Long.valueOf(teamId);
for (Iterator iter = existingPP.getTeams().iterator(); iter.hasNext();) {
ProgramTeam temp = (ProgramTeam) iter.next();
if (temp.getId() == team_id) {
existingPP.getTeams().remove(temp);
break;
}
}
programManager.saveProgramProvider(existingPP);
}
setEditAttributes(request,providerManager.getProvider(provider.getProviderNo()));
providerForm.set("program_provider",new ProgramProvider());
return mapping.findForward("edit");
}
示例15: assign_role
import org.apache.struts.action.DynaActionForm; //导入依赖的package包/类
public ActionForward assign_role(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) {
DynaActionForm providerForm = (DynaActionForm)form;
Provider provider = (Provider)providerForm.get("provider");
ProgramProvider pp = (ProgramProvider)providerForm.get("program_provider");
ProgramProvider existingPP = null;
if( (existingPP = programManager.getProgramProvider(provider.getProviderNo(),String.valueOf(pp.getProgramId())) ) != null) {
if(pp.getRoleId().longValue() == 0) {
programManager.deleteProgramProvider(String.valueOf(existingPP.getId()));
} else {
existingPP.setRoleId(pp.getRoleId());
programManager.saveProgramProvider(existingPP);
}
} else {
pp.setProviderNo(provider.getProviderNo());
programManager.saveProgramProvider(pp);
}
setEditAttributes(request,providerManager.getProvider(provider.getProviderNo()));
providerForm.set("program_provider",new ProgramProvider());
return mapping.findForward("edit");
}