小编Eri*_*k T的帖子

使用Redirect Class时,Laravel白屏

当我在处理数据后尝试使用Laravel Redirect类重定向用户时,我目前正在获得白屏死机.如果我使用原生的php-function标题("location ..."),应用程序会正确响应并以快乐的方式发送用户,但是使用Laravel的Redirect类,网站会因白屏死机而崩溃.我已经尝试了Redirect :: action和Redirect :: to函数,但它们都导致同样令人恼火的白屏死机.laravel.log什么都没显示......

有没有人有任何想法?

以下是数据处理程序控制器类的代码:

<?php
class ManagerLayoutDataController extends BaseController 
{
public function route($action, $moduleID) {
    if(method_exists('ManagerLayoutDataController',$action)) {
        $this->$action($moduleID);
    }
    // Invalid action (method not found)
    else {
        die('Action routing error');
        //return Redirect::to('/');
    }
}

public function updateHeaderBg($moduleID) {
    $image = Input::file('img');
    $user = Auth::user();
    $siteID = $user->getSiteID();

    $layoutDataMessage = null;

    // Validate file upload (NOT FILE CHARACTERISTICS)
    if(Input::hasFile('img') && $image->isValid() && isset($siteID) && $siteID !== "") {
        $res = ManagerFileUpload::uploadImage($siteID, $image);
        if($res->success) {
            $fileName = …
Run Code Online (Sandbox Code Playgroud)

php redirect laravel-4

6
推荐指数
1
解决办法
1024
查看次数

Thymeleaf (Java Spring):无法让 mvc.uri 工作

我最近开始使用 Spring.io 和 Spring Boot 进行开发,并将 Thymeleaf 集成到我的 Web 应用程序中。我现在正在尝试使用mvc.uri实现反向路由,但我似乎无法使其工作。

这是HomeController显示我尝试反向路由的视图的 Web 控制器 ( ):

package com.twlab.billigalan.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.method.annotation.MvcUriComponentsBuilder;

@Controller
public class HomeController {

    @RequestMapping("/")
    @ResponseBody
    public ModelAndView home() {
        //String url = MvcUriComponentsBuilder.fromMappingName("HousingLoansController#main").build();
        ModelAndView model = new ModelAndView();
        //model.addObject("url",url);
        model.setViewName("pages/main/home");
        return model;
    }

    @RequestMapping("/server-error")
    public String error(HttpServletRequest request, Model model) {
        model.addAttribute("errorCode", request.getAttribute("javax.servlet.error.status_code"));
        Throwable throwable = (Throwable) request.getAttribute("javax.servlet.error.exception");
        String errorMessage = null;
        if …
Run Code Online (Sandbox Code Playgroud)

java spring spring-mvc thymeleaf

5
推荐指数
1
解决办法
2534
查看次数

标签 统计

java ×1

laravel-4 ×1

php ×1

redirect ×1

spring ×1

spring-mvc ×1

thymeleaf ×1