Skip to Main Content

ORDS, SODA & JSON in the Database

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to disable default redirect to absolute URL /apex/f?p=120

CasufiOct 16 2013

If I open apex page via URL http://domain.local/apex/ apex listener redirects me to the absolure URL /apex/f?p=DEFAULT_APP:LOGIN:

Is it possible to configure apex listener to redirect to the relaticve URL ./f?p=DEFAULT_APP:LOGIN: instead of absolute?

Comments

User_LM318

Found the cause... In my WEB API I was returning a string but APEX seems to be expecting an HTTP response.
So changed:
public string Put(Department dep)
{
try
{
string query = @"
update dbo.Department set DepartmentName=
'" + dep.DepartmentName + @"'
where DepartmentId="+dep.DepartmentId+@"
";
DataTable table = new DataTable();
using (var con = new SqlConnection(ConfigurationManager.
ConnectionStrings["EmployeeAppDB"].ConnectionString))
using (var cmd = new SqlCommand(query, con))
using (var da = new SqlDataAdapter(cmd))
{
cmd.CommandType = CommandType.Text;
da.Fill(table);
}

           **return "Successfuly updated row!";**  
       }  
       catch (Exception)  
       {  
           **return "Could not update row!";**  
       }  
   }  

to

public HttpResponseMessage Put(Department dep)
{
try
{
string query = @"
update dbo.Department set DepartmentName=
'" + dep.DepartmentName + @"'
where DepartmentId="+dep.DepartmentId+@"
";
DataTable table = new DataTable();
using (var con = new SqlConnection(ConfigurationManager.
ConnectionStrings["EmployeeAppDB"].ConnectionString))
using (var cmd = new SqlCommand(query, con))
using (var da = new SqlDataAdapter(cmd))
{
cmd.CommandType = CommandType.Text;
da.Fill(table);
}

           **return Request.CreateResponse(HttpStatusCode.OK, table);**  
       }  
       catch (Exception)  
       {  
           **return Request.CreateResponse(HttpStatusCode.NotFound, "Could not update row!");**  
       }  
   }  

Hope it helps someone!

1 - 1
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Nov 13 2013
Added on Oct 16 2013
0 comments
1,089 views